- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10711 Articles for Web Development
![Amit D](https://www.tutorialspoint.com/assets/profiles/13349/profile/60_63530-1512538715.jpg)
660 Views
To change text decoration property with jQuery, use the jQuery css() property.ExampleYou can try to run the following code to change text-decoration property from underline to overline:Live Demo $(document).ready(function(){ $("p").on({ mouseenter: function(){ $(this).css({"text-decoration": "overline"}); } }); }); p { text-decoration: underline; } Move the mouse pointer on the text to remove underline and add overline.
![Amit D](https://www.tutorialspoint.com/assets/profiles/13349/profile/60_63530-1512538715.jpg)
388 Views
To remove underline from a text in jQuery, use the jQuery css() method. The css property text-decoration property is used with none value.ExampleYou can try to run the following code to remove underline:Live Demo $(document).ready(function(){ $("p").on({ mouseenter: function(){ $(this).css({"text-decoration": "none"}); } }); }); p { text-decoration: underline; } Move the mouse pointer on the text to remove underline.
![Amit D](https://www.tutorialspoint.com/assets/profiles/13349/profile/60_63530-1512538715.jpg)
3K+ Views
To make text bold, italic and underline using jQuery, use the jQuery css() method with the CSS properties font-style, font-weight and text-decoration. You can try to run the following code to learn how to make text bold, italic and underline using jQuery −ExampleLive Demo $(document).ready(function(){ $("p").on({ mouseenter: function(){ $(this).css({"font-style": "italic", "font-weight": "bold","text-decoration": "underline"}); } }); }); Move the mouse pointer on the text to make text bold, italic and underline.
![Amit D](https://www.tutorialspoint.com/assets/profiles/13349/profile/60_63530-1512538715.jpg)
2K+ Views
To change the font family and font size with jQuery, use the jQuery css() method. The css property font-family and font-size is used. You can try to run the following code to learn how to change font family and font size with jQuery −ExampleLive Demo $(document).ready(function() { $("p").on({ mouseenter: function() { $(this).css({"font-family": "Arial, Helvetica, sans-serif", "font-size": "200%"}); } }); }); Move the mouse pointer on the text to change the font family and size.
![Amit D](https://www.tutorialspoint.com/assets/profiles/13349/profile/60_63530-1512538715.jpg)
11K+ Views
To change the text color with jQuery, use the jQuery css() method. The color css property is used to change text color.ExampleYou can try to run the following code to learn how to change text color with jQuery −Live Demo $(document).ready(function(){ $("p").on({ mouseenter: function(){ $(this).css("color", "red"); } }); }); Move the mouse pointer on the text to change the text color.
![Amit D](https://www.tutorialspoint.com/assets/profiles/13349/profile/60_63530-1512538715.jpg)
3K+ Views
You cannot return variable value from jQuery event function. To understand the reason, let us see how data is passed, which was created in the event handler of a button click.ExampleLive Demo $(document).ready(function(){ var a=document.getElementById('demo'); a.addEventListener('click', function(){ var s='Hello World!'; var event = new CustomEvent('build', { 'detail': s }); this.dispatchEvent(event); }) document.getElementById('parent').addEventListener('build', getData, true); function getData(e){ alert(e.detail); } }); Click me
![Alex Onsman](https://www.tutorialspoint.com/assets/profiles/13357/profile/60_91536-1512482971.jpg)
631 Views
To bind jQuery events within dynamic content, use event delegation. You can try to run the following code to learn how to bind jQuery events within dynamic content returned via Ajax:Live Demo $(document).ready(function(){ $(".loadingAjax").on("click", function() { event.preventDefault(); var url = $(this).attr("href"), appendedContainer = $(".append"); $.ajax({ url: url, type : 'get', complete : function( qXHR, textStatus ) { if (textStatus === 'success') { var data = qXHR.responseText appendedContainer.hide(); appendedContainer.append("Hi"); appendedContainer.fadeIn(); } } }); }); $(document).on("click", '.link', function(event) { alert("Link clicked!"); }); }); a.test { font-weight: bold; } body { font-family: sans-serif;} Click to load Ajax
![Alex Onsman](https://www.tutorialspoint.com/assets/profiles/13357/profile/60_91536-1512482971.jpg)
2K+ Views
To handle the checkbox checked state, use the change event. It will check whether the checkox is checked or not.ExampleYou can try to run the following code to learn how to handle when checkbox checked state changed event in jQuery −Live Demo jQuery Checkbox state b { color: red; } Check/ Uncheck this checkbox $( "input" ).change(function() { var $input = $( this ); $( "p" ).html( ".attr( \"checked\" ): " + $input.attr( "checked" ) + "" + ".prop( \"checked\" ): " + $input.prop( "checked" ) + "" + ".is( \":checked\" ): " + $input.is( ":checked" ) + "" ); }).change();
![Alex Onsman](https://www.tutorialspoint.com/assets/profiles/13357/profile/60_91536-1512482971.jpg)
197 Views
Yes, you can wrap a JavaScript event in a jQuery event. For wrapping, use the event object. You can try to run the following code to wrap a JavaScript event in a jQuery event −ExampleLive Demo $(document).ready(function(){ $('a.one').click(function(event){ event.preventDefault(); }); function test(event){ $.Event(event).preventDefault(); } }); a.test { font-weight: bold; } body { font-family:sans-serif; } Tutorials QA
![Alex Onsman](https://www.tutorialspoint.com/assets/profiles/13357/profile/60_91536-1512482971.jpg)
2K+ Views
To disable cut, copy and paste of a content in jQuery, use the jQuery bind() function.ExampleYou can try to run the following code to disable copy paste of content using jQuery −Live Demo $(document).ready(function(){ $('#mytext').bind("cut copy paste",function(e) { e.preventDefault(); }); }); Copy, cut and paste function doesn't work here.