Answer & Solution
$('div').height('200px');
elements to 200 pixels?
<div>
elements to 200 pixels?
$('div').height('200px');
Which jQuery method is used to change the font weight of all<h2>
elements to bold?
A). $('h2').style('font-weight', 'bold');
B). $('h2').fontWeight('bold');
C). $('h2').css('font-weight', 'bold');
D). $('h2').bold();
How to set the value of the placeholder attribute to 'Enter text' for all <input>
elements using jQuery?
A). $('input').placeholder('Enter text');
B). $('input').setAttribute('placeholder', 'Enter text');
C). $('input').attr('placeholder', 'Enter text');
D). $('input').attr('placeholder', 'Enter text');
Which jQuery method is used to add the class 'highlight' to all <div>
elements?
A). $('div').addClass('highlight');
B). $('div').class('highlight');
C). $('div').attr('class', 'highlight');
D). $('div').applyClass('highlight');
How to change the font color of all <span>
elements to blue using jQuery?
A). $('span').fontColor('blue');
B). $('span').color('blue');
C). $('span').css('color', 'blue');
D). $('span').style('color', 'blue');
How to change the font family of all<p>
elements to 'Arial' using jQuery?
A). $('p').style('font-family', 'Arial');
B). $('p').fontFamily('Arial');
C). $('p').css('font-family', 'Arial');
D). $('p').font('Arial');
How to add the class 'active' to all<li>
elements within a<ul>
using jQuery?
A). $('ul li').setAttribute('class', 'active');
B). $('ul li').add('active');
C). $('ul li').addClass('active');
D). $('ul li').setAttribute('class', 'active');
How to remove the href attribute from all anchor elements using jQuery?
A). $('a').removeAttr('href');
B). $('a').removeAttr('href');
C). $('a').deleteAttr('href');
D). $('a').removeAttribute('href');
How to change the src attribute of an<img>
element using jQuery?
A). $('img').attr('src', 'newimage.jpg');
B). $('img').src = 'newimage.jpg';
C). $('img').setAttribute('src', 'newimage.jpg');
D). $('img').srcAttr('newimage.jpg');
How to change the alt attribute of all <img>
elements to 'New Image' using jQuery?
A). $('img').alt('New Image');
B). $('img').setAttribute('alt', 'New Image');
C). $('img').attr('alt', 'New Image');
D). $('img').setAttr('alt', 'New Image');
Which jQuery method is used to change the width of all <div>
elements to 300 pixels?
A). $('div').width('300px');
B). $('div').setWidth('300px');
C). $('div').css('width', '300px');
D). $('div').style('width', '300px');
Copyright © RVR Innovations LLP 2024 | All rights reserved - Mytat.co is the venture of RVR Innovations LLP