0
我想提取這個日期,並將其與另外一個比較:比較字符串日期html的
<table id="table">
<tbody>
<tr><th>Date</th><td>05/12/2016</td></tr>
</tbody>
</table>
也許是這樣的:
var date = document.getElementById("table").children[0].children[1].innerHTML;
var new_date = 06/12/2016;
if (date < new_date) ...
有誰知道如何做到這一點?
不需要''getTime'',日期對象可比較 – roger
謝謝羅傑。我會修改。 –
謝謝!我怎麼能以這種格式(MM/DD/YYYY)得到今天的日期? – Sergio