Ninjas Web Developer

  Home  Web Development  Ninjas Web Developer


“Web Development Ninjas related Frequently Asked Questions in various Ninjas Web Developer job interviews by interviewer. The set of questions here ensures that you offer a perfect answer posed to you. So get preparation for your new job hunting”



58 Ninjas Web Developer Questions And Answers

44⟩ Tell me what is the difference between detach() and remove() methods in jQuery?

Though both detach() and remove() methods are used to remove a DOM element, the main difference between them is that detach() keeps track of the last element detached, so that it can be reattached, while the remove() method does keep a reference of the last removed method. You can also take a look at the appendTo() method for adding elements into DOM.

 206 views

45⟩ Do you know what are the new image elements in HTML5?

Canvas and WebGL. <Canvas> is a new element that acts as a container for graphical elements like images and graphics. Coupled with JavaScript, it supports 2D graphics. WebGL stands for Web Graphics Language, a free cross-platform API that is used for generating 3D graphics in web browsers.

 249 views

47⟩ Explain me the difference between cookies, sessionStorage, and localStorage?

Cookies are small text files that websites place in a browser for tracking or login purposes. Meanwhile, localStorage and sessionStorage are new objects, both of which are storage specifications but vary in scope and duration. Of the two, localStorage is permanent and website-specific whereas sessionStorage only lasts as long as the duration of the longest open tab.

 262 views

48⟩ Explain me how do you set an attribute using jQuery?

One more follow-up question of previous jQuery question, attr() method is overload like many other methods in JQuery. If you call attr() method with value e.g. attr(name, value), where name is the name of attribute and value is the new value.

 237 views

49⟩ Explain me what is $(document).ready() function? Why should you use it?

This is one of the most important and frequently asked questions. The ready() function is used to execute code when document is ready for manipulation. jQuery allows you to execute code, when DOM is fully loaded i.e. HTML has been parsed and the DOM tree has been constructed. The main benefit of $(document).ready() function is that, it works in all browser, jQuery handles cross browser difficulties for you. For curious reader see answer link for more detailed discussion.

 221 views

52⟩ Please explain difference between $(this) and this keyword in jQuery?

This could be a tricky question for many jQuery beginners, but indeed it’s a simple one. $(this) returns a jQuery object, on which you can call several jQuery methods e.g. text() to retrieve text, val() to retrieve value etc, while this represent current element, and it’s one of the JavaScript keyword to denote current DOM element in a context. You can not call jQuery method on this, until it’s wrapped using $() function i.e. $(this).

 209 views

53⟩ Tell me what is HTML?

HTML stands for HyperText Markup Language. It is the dominant markup language for creating websites and anything that can be viewed in a web browser. If you want to get some extra bonus points

 191 views

54⟩ Tell me how do you add an HTML element in DOM tree?

You can use the jQuery method appendTo() to add an HTML element in DOM tree. This is one of the many DOM manipulation methods that jQuery provides. You can add an existing element or a new HTML element, appendTo() add that method in the end of a particular DOM element.

 207 views

58⟩ Explain me what are the new media-related elements in HTML5?

HTML5 has strong support for media. There are now special <audio> and <video> tags. There are additional A/V support tags as well: <embed> is a container for 3rd party applications. <track> is for adding text tracks to media. <source> is useful for A/V media from multiple sources.

 219 views