Home  >  Q&A  >  body text

JQ setting problem, a new problem occurs after adding a link to the p tag, the code is as follows

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http:/ /cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(document).ready(function() {
                                                                                                                                            $("#btn1"). btn2").click(function(){
                                                                                                                                                     ("#btn3").click(function(){
                                                                                                           /script>
</head>
<body>
<p id="test1" ><a href="http://www.php.cn" >This This is the <B>bold</B> part of the paragraph</p>
<p id="test2" >This is the <B>bold</B> Part</p>
<p >Part:<input type="text" id="test3" value="中文网"></p>
<button id= "btn1">Set text</button>
<button id="btn2">Set html</button>
<button id="btn3">Set table parameters</ button>
</body>
</html>

After pressing btn1, btn2, and btn3, the settings are normal, but they all automatically jump to the php Chinese website page. I don’t understand why. What's going on?

btn1 jumps to the past and I can still understand it (actually I don’t understand why)

btn2 and btn3 will jump after setting them up, I’m confused

Please give me some explanation !

益伦益伦2539 days ago1567

reply all(1)I'll reply

  • ℡浮生灬若梦

    ℡浮生灬若梦2017-10-08 14:27:04

    Your a tag does not have an ending tag

    reply
    1
  • Cancelreply