Previous Next

Interview Questions on JQuery

1. What is the difference b/w javascript and jquery?

Javascript is a programming language whereas jQuery is a framework to help make writing in
javascript easier. It's particularly useful for simply traversing the DOM in an HTML

2. Is JQuery server side scripting language?

No.

3. What is extension of jquery files and how to link it in html?

.js  they are  javascript files.

4. Where can we write jquery code?

Any where. 
Inside <head></head> or 
<body></body> or
<div></div>

5. Write a jquery code to pop up alert box?

alert(‘alert text goes here’);

6. Can we write javascript code in jquery?

Yes.

7. How to add styles to particular html element?

$(‘element’).css(‘propertyname,vaule);
Ex :- $(‘.container).css(‘color’,’#333’);

8. How to get html code of div?

$( "element" ).html();
$( "div.demo-container" ).html();

9. How to change the content of particular div element?

$( "element" ).text(content_string1);
Ex:- $( ".container" ).text(string1);

10. How to append the content to particular div element?

$(selector).append(content_string1);

Previous Next