Joydip Panchal Javascript Tutorial
html - How to get div element values in javascript???

To get value from any Div element, first give it id and then access it by its id.

Example :
<html>
<head>
<script type='text/javascript'>
function showValue()
{
alert(document.getElementById('pText').innerHTML);
}
</script>
</head>
<body>
<p id='pText'>Help2engg</p>
<button onclick='showValue()'>Click Me</button>
</body>
</html>
Like · Comment ·
Admin and 2 other like this

Moni Kachhadiya

hey friend if any one have 7th IT papper of modasa engg college then plezz plezz upload as soon as possible(all papper))
Like ·
Download Android App