Showing posts with label Javascript. Show all posts
Showing posts with label Javascript. Show all posts

Set div’s all anchor tags onclick event using javascript

Here is an example to set all child anchor tags onclick event.
A div (id str1) has 3 anchor tags (First, Second and Third). When user clicks on any link, it should call “ShowValue” javascript method which displays text of that link. We have to set onclick event dynamically using javascript. See following for this: