Adding inline styles to html element using JQuery

8 sec read

  1. This can be done by using the css JQuery function. Read more
  2. An example is
    $("#myElement").css('border','1px solid #FF0066');
  3. The example above will produce the following
    <input style="1px solid #FF0066" id="myElement" />

Last Updated On March 21, 2018

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Bram Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Bram
Guest

It should produce this 🙂 Notice the “border:” statement.