🔒 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
  • 344
    Views
  • 2
    Participants
Last reply from:
SUNRAI

Trending Topics

Online now

Members online
1,096
Guests online
2,215
Total visitors
3,311

Forum statistics

Threads
2,294,124
Posts
29,088,818
Members
1,208,088
Latest member
Wiizzeee
Back
Top