jQuery anchor preventDefault

后端 未结 3 764
情书的邮戳
情书的邮戳 2021-01-04 09:49

Using jQuery, how do I get the value from a textbox and then load a new page based on the value?

For example, lets say the textbox contains \"hello\" on page1.php, h

3条回答
  •  一整个雨季
    2021-01-04 10:34

    Html

        
        Iam a link
    

    Javascript

    jQuery('#demoLink').bind('click',function(e){
          e.preventDefault();
          document.location.href="someUrl.php?text="+ jQuery('#demoQuery').val();     
    });
    

提交回复
热议问题