Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNirmal Kumar
Courses Plus Student 216 PointsJquery
I have designed a page based on html 5 & css. This page have a div which have a form and is hidden by using css property.
Now on the page there is a button which on click shows the form as modal
$("#createXyz").click(function(){ $("#div").show(); })
This works fine,but the form have a different css file.
I want before the modal form lodes its respective css file also gets loaded and its css can be seen by the end user.
1 Answer
Ella Ruokokoski
20,881 PointsYou could maybe append a link tag with your CSS file for the form into the head tag in the click function?
var formStyles = $('<link rel="stylesheet" href="yourstylefilehere.css">');
$("head").append(formStyles);
Nirmal Kumar
Courses Plus Student 216 PointsNirmal Kumar
Courses Plus Student 216 PointsThx Ella,it worked