jQuery

Adding inline styles to html element using JQuery

Written by Ian Carnaghan · 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
Written by Ian Carnaghan
I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment. Profile

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.