การอ่านค่าจาก id ของ tag html ด้วย jquery
เช่นมี tag p มี id= example_placeholder
โค้ด: เลือกทั้งหมด
<p id="example_placeholder">Existing content that will be replaced.</p>
อ่านค่าโดยใช้
และถ้าจะกำหนดค่าให้ กับ id ของ tag ใช้
โค้ด: เลือกทั้งหมด
$('#example_placeholder').html('This existing content has been replaced with this content.');
เพิ่มค่าลงใน id
โค้ด: เลือกทั้งหมด
$('#example_placeholder').append(' This text has been appended to the end.');