Home  >  Q&A  >  body text

How to write to change two attributes

$('input[type]').css('background','pink') This is to change an attribute, if you want to add width and height. How to write it?

梦神梦神2184 days ago1443

reply all(1)I'll reply

  • 清浅

    清浅2018-11-21 09:31:35

    You can use the attr attribute in jQuery to change multiple style values

    $("input[type]").attr({width:"100px",height:"100px",background:"pink"});


    reply
    0
  • Cancelreply