🔒 Closed jquery chaining help

Status
Not open for further replies.

SUNRAI

Eternal Poster
ask lang about chaining kunyare may button ako at gusto ko ang function nya is 2 magkaibang html yung papalitan tama ba yung ganitong code?
Code:
<script>
$(funtion() {
$("#btn1").click(function(){
  $("#ex").html("<p>new content</p>")
   . ("#ex1).html("<h1>new title</h>);
  });
});
</script>
<body>

<p id = "ex">content</p>

<h1 id ="ex1">title</h>

</body
 
Walang dot ganito lang

Code:
$(funtion() {
$("#btn1").click(function(){
   $("#ex").html("<p>new content</p>")
   $("#ex1).html("<h1>new title</h>);
  });
});
 
Status
Not open for further replies.

About this Thread

  • 3
    Replies
  • 307
    Views
  • 2
    Participants
Last reply from:
SUNRAI

Online now

Members online
947
Guests online
3,074
Total visitors
4,021

Forum statistics

Threads
2,276,136
Posts
28,967,815
Members
1,231,128
Latest member
Dedegodskga
Back
Top