Home > Web Front-end > HTML Tutorial > How to get the value of Chinese text in hyperlink_html/css_WEB-ITnose

How to get the value of Chinese text in hyperlink_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:09:47
Original
890 people have browsed it

China
How to take out the value of "China" and pass it as a parameter to login.jsp


Reply to the discussion (solution)

Use the InnerText attribute to extract using Javascript. It is best to set an ID so that you can get the tag element you want to get the value through GetElementById.

<a href="login.jsp">中国</a><script type="text/javascript">document.getElementsByTagName('a')[0].onclick = function() {	this.href += '?country=' + encodeURIComponent(this.innerHTML);}</script>
Copy after login

HTML code

China

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template