i need to access the value of paragraph tag using dom in javascript.
lets say there is <p id="test">this is test para </p>
now how to access the value inside this para ie. "this is test para"?
i have tried:
var text = document.getEle mentById("test" ).value, also tried document.getEle mentById("test" ).firstChild
but none of them return value of paragraph.
where as in case of textarea i can access this value inside it by
document.getEle mentById("someI d").value
please help me. i need to resolve this very urgently.
thanks in advance.
lets say there is <p id="test">this is test para </p>
now how to access the value inside this para ie. "this is test para"?
i have tried:
var text = document.getEle mentById("test" ).value, also tried document.getEle mentById("test" ).firstChild
but none of them return value of paragraph.
where as in case of textarea i can access this value inside it by
document.getEle mentById("someI d").value
please help me. i need to resolve this very urgently.
thanks in advance.
Comment