line 1:
line 2:
Your question is all over the place - the question / HTML / JavaScript dont match up .... below is a way to update the href
and text of an anchor
(not a div
) on the click of a button
#msdhoni
JavaScript :
$('#Button1').click(function() {
$('#Link1').attr('href',"http://search.twitter.com/search?q=#" + $('#Text1').val());
$('#Link1').text("#" + $('#Text1').val());
});
Note: You need to add an ID
to the anchor to make this code work