Thuộc tính cite của đối tượng ins trong HTML DOM trả về URL của tài liệu giải thích lý do văn bản được chèn vào.
Cú pháp
Trả về giá trị chuỗi:
insObject.cite
Ví dụ
Ví dụ minh họa thuộc tính ins cite:
<!DOCTYPE html> <html> <head> <title>ins cite</title> <style> form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } </style> </head> <body> <form> <fieldset> <legend>ins-cite</legend> <h1>Thực tế:</h1> <p>Nước không thể tồn tại trên bề mặt Mặt Trăng.<ins id="newInfo" cite="https://www.example.com/water-ice-moon-surface-confirmed.html">Băng nước được tìm thấy trên Mặt Trăng vào năm 2018.</ins> </p> <input type="button" onclick="showURL()" value="Hiện bằng chứng"> <div id="divDisplay"></div> </fieldset> </form> <script> var divDisplay = document.getElementById("divDisplay"); var insCite = document.getElementById("newInfo"); function showURL() { divDisplay.textContent = 'Evidence at: '+insCite.cite; } </script> </body> </html>
Kết quả
Trước khi nhấn nút 'Hiện bằng chứng':

Sau khi nhấn nút 'Hiện bằng chứng':
