StepsEasy
jQuery Selectors - Example
Run
Reset
Destroy & Close
← Back to lesson
Code Editor
javascript
$(document).ready(function() { // Element selector $('p').css('color', 'blue'); // Class selector $('.highlight').css('background', 'yellow'); // ID selector $('#title').text('New Title'); // Attribute selector $('a[target="_blank"]').css('color', 'red'); // First/last child $('ul li:first').addClass('active'); });
Result
Click "Run" to execute the code...
Loading runtime...
Ready
JAVASCRIPT | In-Browser Execution