Posted By

brianyang on 12/25/10


Tagged


Versions (?)

Assignment Syntax


 / Published in: JavaScript
 

  1. element.setAtribute("width",300);
  2.  
  3. var setAttribute = function(element, key, value){
  4. element.setAttribute(key, value);
  5. }
  6.  
  7. setAttribute(element, "width", 300);
  8.  
  9. var setAttribute = "setAttribute";
  10.  
  11. element[setAttribute]("width", 300);

Report this snippet  

You need to login to post a comment.