- 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 8895 Articles for Front End Technology
5K+ Views
To set the background color using jQuery, use the jQuery css() property. We will set background color on mouse hover with the jQuery on() method.ExampleYou can try to run the following color to set background color in jQuery.Live Demo $(document).ready(function(){ $("body").on({ mouseenter: function(){ $(this).css("background-color", "gray"); }, }); }); Move the mouse pointer on the page to change the background color.
9K+ Views
To change the background color using jQuery, use the jQuery css() property. We will change background color on mouse hover with the jQuery on() and css() method. ExampleYou can try to run the following code to learn how to change background color using jQuery:Live Demo $(document).ready(function(){ $("body").on({ mouseenter: function(){ $(this).css("background-color", "gray"); }, mouseleave: function(){ $(this).css("background-color", "red"); }, dblclick: function(){ $(this).css("background-color", "yellow"); } }); }); Double click and move the mouse pointer to change the background color.
572 Views
To remove underline from text hyperlink on hover using jQuery, use the jQuery css() property. The color text-decoration property is used with value none.ExampleYou can try to run the following code to learn how to remove underline from text hyperlink:Live Demo jQuery Text Decoration $(document).ready(function() { $('a').hover( function () { $(this).css({"text-decoration":"none"}); }); }); a { text-decoration: underline; } Demo text
468 Views
To underline a hyperlink on hover using jQuery, use the jQuery css() property. The color text-decoration property is used.ExampleYou can try to run the following code to learn how to underline a hyperlink on hover:Live Demo jQuery Hyperlink Decoration $(document).ready(function() { $('a').hover( function () { $(this).css({"text-decoration":"underline"}); }); }); a { text-decoration: none; } Demo text
661 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.
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.
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.
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.
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.
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