Home > Web Front-end > HTML Tutorial > Super simple question, novice asking for help_html/css_WEB-ITnose

Super simple question, novice asking for help_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:25:41
Original
913 people have browsed it

Regarding href parameter passing, the value to be passed is the value of a certain input, for example,
href, for example, is , put the input value in href, how to achieve it


Reply to discussion (solution)

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> 
Copy after login


JS function
function goto(){  alert($("#hidden1").val())}
Copy after login


Result


Maybe you will $("#hidden1").val( ) followed by the URL you want to redirect

<!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>
Copy after login




What a big head! !

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template