how to link javascript to html and css
# Javascript
<script src="[file_name].js"></script>
# CSS
<link rel = "stylesheet" type="text/css" href = "style.css" />
how to link javascript to html and css
# Javascript
<script src="[file_name].js"></script>
# CSS
<link rel = "stylesheet" type="text/css" href = "style.css" />
link stylesheet in javascript
var cssId = 'myCss'; // you could encode the css path itself to generate id..
if (!document.getElementById(cssId))
{
var head = document.getElementsByTagName('head')[0];
var link = document.createElement('link');
link.id = cssId;
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'http://website.com/css/stylesheet.css';
link.media = 'all';
head.appendChild(link);
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us