Simple jQuery Selector Class Change
How do I make an simple jquery selector class change?
What is a simple jquery selector class change? How do you make a simple jquery selector class change? This script and codes were developed by James Zedd on 09 January 2023, Monday.
Simple jQuery Selector Class Change - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Simple jQuery Selector Class Change</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <p class="foo foo-over"> This item ships for free!
</p>
<p class="foo foo-under"> Orders $50 or over will Ship for free!
</p>
<select id="price_selector"> <option value="over-50">Over $50</option> <option value="under-50">Under $50</option>
</select> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Simple jQuery Selector Class Change - Script Codes CSS Codes
.show {color: blue;}
.hide {color: red;}
Simple jQuery Selector Class Change - Script Codes JS Codes
$('.foo-over').addClass('show');
$('.foo-under').addClass('hide');
$('#price_selector').change(function(){ if ($('#price_selector').val() == 'over-50') { $('.foo-over').removeClass('hide').addClass('show'); $('.foo-under').removeClass('show').addClass('hide'); } else { $('.foo-over').removeClass('show').addClass('hide'); $('.foo-under').removeClass('hide').addClass('show'); }
});

Developer | James Zedd |
Username | james_zedd |
Uploaded | January 09, 2023 |
Rating | 3 |
Size | 1,802 Kb |
Views | 2,023 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Pure CSS Slide Out Menu | 2,907 Kb |
CSS Menu Item Transition and Image Animation | 2,184 Kb |
Price | 3,043 Kb |
HTML for IID | 1,792 Kb |
Modern Responsive Product Comparison Table for E-commerce | 2,538 Kb |
The Lonely Planet | 8,286 Kb |
A Pen by James Zedd | 2,674 Kb |
Flex Chart | 4,111 Kb |
Simple Package Tier Display | 2,522 Kb |
Flex | 2,796 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Simple Login Form Template | Banunn | 3,571 Kb |
Layout | X-gyba | 4,234 Kb |
A Pen by Jay | Jaycode | 3,784 Kb |
Isometric css island | Xaddict | 2,950 Kb |
Clock with full screen background | Owebboy | 2,415 Kb |
A Pen by Huan Nghiem | Nightshade | 10,646 Kb |
Simple Linear Regression with Editable Table | Melatonind | 3,264 Kb |
Minimal Menu | Achudars | 3,430 Kb |
Email Marketing Mock | Kristenzirkler | 8,224 Kb |
Highbrow Basic HTML Lesson 8 | Kimlarocca | 2,094 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!