Message.js

function GetContent (){ var elem = document.getElementById ("my div"); var message = ""; if (elem.outerHTML !== undefined) { message +="outerHTML:" + elem.outerHTML } if (elem.outerText !== undefined ) { message += "nouterText :" + elem.outerText; } message += "ninner HTML" + elem.innerHTML; if (elem.textContent === undefined ) { message += "ninner Text :" + elem.innerText; } else { message += "ninner text:" + elem.textContent; } alert (message); }
innerhtml Functions

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.