Sunday, 11 August 2013

Pass data from div tags to javascript function

Pass data from div tags to javascript function

HTML
<li id="a1">
<div><p>Some Text1!</p></div>
<div><a href="#"></a>Some Text2!</div>
<div><input id="a1b" type="button" onClick="fun()"/></div>
</li>
How can I get Some Text1! and Some Text2! ,i.e, some text from first and
second div and pass it to function fun() in third div?

No comments:

Post a Comment