Rohit Bajaj
asked on
Include css using javascript/jquery in html
Hi,
I am creating a search filter...in javascript library..
User will have an html element like <div id="filter/>
And pass the filter to my library...
My lib will replace this element with the html of the search filter....And my lib will also include js code required to interact with this search filter...
Here is the code as of now :
How do i include css to style this.
One way proabably i coudl make a css file and bundle it with my javascript file .
Any alternative way ??
Thanks
I am creating a search filter...in javascript library..
User will have an html element like <div id="filter/>
And pass the filter to my library...
My lib will replace this element with the html of the search filter....And my lib will also include js code required to interact with this search filter...
Here is the code as of now :
var html = '<div class="ring-js-filter"> \
<input type="text" class="ring-js-input" value="..." placeholder="Search.." autocomplete="off"> \
<div class="ring-js-close-icon" id="ring-js-fliterclose"></div> \
<div class="ring-js-drop-down"> \
</div> \
</div>';
$(id).replaceWith(html);
filter.setupSearchFilter();
This code is inside my lib and also include js code to interact with it...How do i include css to style this.
One way proabably i coudl make a css file and bundle it with my javascript file .
Any alternative way ??
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.