document.getElementById("msg").innerText is perfect for IE, but Firefox.
document.getElementById("msg").textContent works for Firefox, but loses all line breaks.
So I come out my solution :
<div style="display: none; visibility: hidden;" id="msg">
Deleting this category will lose all articles.
Do you really want to do it?</div>
<SCRIPT>
function confirmDeletion() {
var msg = document.getElementById("msg").innerHTML.replace(/
/ig,"\n");
if (confirm(msg) ) {
....
form.submit();
}
return false;
}
</SCRIPT>
No comments:
Post a Comment