assign value of html textbox to title of div

前端 未结 1 1281
天涯浪人
天涯浪人 2021-01-28 06:37

line 1:


line 2:



        
1条回答
  •  天涯浪人
    2021-01-28 07:08

    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

    0 讨论(0)
提交回复
热议问题