jQuery Tutorial for Beginners #10 - Wrap and Unwrap Elements

preview_player
Показать описание
Heeeey gang. In this jQuery tutorial for beginners, I'll show you how we can wrap and unwrap HTML elements in jQuery. This technique has quite a lot of uses, such as placing a disabling wrapper over a button you do not want to be pressed.

The 3 jQuery methods I'll be showing you are wrap() , unwrap() & wrapAll(). Any questions, just ask :).

========== JavaScript for Beginners Playlist ==========

========== CSS for Beginners Playlist ==========

========== HTML for Beginners Playlist ==========

========== The Net Ninja ============

========== Social Links ==========

Рекомендации по теме
Комментарии
Автор

Hey man, I'm an experienced software engineer doing server side(3 years while serving in the army 2 more years at a startup)and i think that your tutorials are a delight very clear and fast phased keep up the good work

bdardik
Автор

Hours of unwrapping/ wrapping fun! Wow, this was a good one.

AngelaAndrews
Автор

Once i used Wrap for youtube videos. And it was only solution ^^

pastuh
Автор

the wrapAll() has to work if and only if what its wrapping is on the same level yh?

Ivsti
Автор

Can we access the webpage you are using for showcasing the examples? I want to see the HTML. Thanks

divyanshubhatnagar
Автор

Hey man, just wanna say awesome tutorial and I have a question: Why didn’t you use the .toggle() method instead of writing the process down in a function yourself?

Sama-mnhh
Автор

$("section").unwrap() --> if there are more than one section tag then which tag will be unwrapped?

ajitsinghal
Автор

I can't get this to work my code is exactly them same

adamchilds
Автор

Another way :

var wrapper = "<div class='wrapper'>";
var is_wrapped = true;


if(is_wrapped){
$("section").unwrap();
$(".button").text("wrap");
is_wrapped=false;
}else{

$(".button").text("unwrap");
is_wrapped=true;
}
})

yasincimic
Автор

please ninja mentor. Why not use $(‘.wrapper’). Instead of “<div class = ‘wrapper’>

emmanuelekwere
welcome to shbcf.ru