Home >Web Front-end >HTML Tutorial >Super simple question, novice asking for help_html/css_WEB-ITnose
Regarding href parameter passing, the value to be passed is the value of a certain input, for example, dafac676f815ef013fc1a05407d9db23
href, for example, is 490f65d28ab4df3b00f2fc84e0d396385db79b134e9f6b82c0b36e0489ee08ed, put the input value in href, how to achieve it
Yours Hyperlinks always have a click event, and write JS to pass it in that event.
<input type="hidden" id="hidden1" name="yhbh" value="123"><a onclick="goto()">goto</a>
function goto(){ alert($("#hidden1").val())}
<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"><title>test</title><script type="text/javascript" src="js/app.js"></script></head><style type="text/css"></style><body><input type="text" value="test" class="txt" /><a href="http://www.test.com" title="" class="link">click</a><script type="text/javascript">$(function(){ var val = $(".txt").val(),href = $(".link").attr("href"); $(".link").attr("href",href +"?aa="+ val);})</script></body></html>
9279c3d0e2ee1ba7f3d8ed2430115225
e9d6c433524b8ecbe4c81862ff9d3024
f07a04e048e54101da6a39b569d731d9
f5a47148e367a6035fd7a2faa965022e
What a big head! !