Organizational Research By

Surprising Reserch Topic

How to change href of <a> tag on button click through javascript


How to change the href attribute value of an tag through Javascript on button click ?



jhg
jhhghj

asked Apr 19, 2015 in PHP by rajesh
0 votes
51 views



Related Hot Questions

1 Answer

0 votes
Without having a href, the click will reload the current page, so you need something like this:

jhhghj
Or prevent the scroll like this:

jhhghj
Or return false in your f1 function and:

jhhghj
....or, the unobtrusive way:

jhg
jhhghj

answered Apr 19, 2015 by rajesh

...