PDA

View Full Version : js: get the contents of a <div>



andr.in
October 24th, 2004, 12:02 PM
I need to retreive the text inside a <div>...
I know I can do mydiv.innerHTML but is there something that retreives the text without including the html?

er... or mby there's something like striptags() in php that removes the html..
:whistle:

senocular
October 24th, 2004, 02:11 PM
textContent for Moz
innerText for IE

andr.in
October 25th, 2004, 02:55 AM
great thx... just what I needed...
I tried innerText myself but I was testing with mozilla :P

senocular
October 25th, 2004, 06:03 AM
yeah, really I hate those kinds of inconsistencies. :sigh: