lundi 13 février 2017

Natively implement $ in javascript

Vote count: 0

I was asked a question to implement the following in Javascript

$(div).css('color','red');

I've implemented the following, but I still need pointers.

var $ = new function(selector){

var css = function(){

  document.classList.add('color:red');

};

};

$.prototype.prop = function(){ //for $(div).prop('style', 'color:red');
// need to write code for prop
}

How can I implement in this case?

$(div).prop('style', 'color:red');

How can i natively implement this in javascript?

asked 45 secs ago

Let's block ads! (Why?)



Natively implement $ in javascript

Aucun commentaire:

Enregistrer un commentaire