include script in html
<script type="text/javascript" src="/path/to/script.js"></script>
include script in html
<script type="text/javascript" src="/path/to/script.js"></script>
include js in html
<html>
<head>
</head>
<body>
<script type="text/javascript" src=es4.js></script>
</body>
</html>
javascript contains substring
var str = "We got a poop cleanup on isle 4.";
if(str.indexOf("poop") !== -1){
alert("Not again");
}
//use indexOf (it returns position of substring or -1 if not found)
how to add script in html head
<script src="script.js" defer></script>
<!--just add defer attribute so script will execute at last-->
include js to js
var imported = document.createElement('script');
imported.src = '/path/to/imported/script';
document.head.appendChild(imported);
javascript includes
const pets = ['cat', 'dog', 'bat'];
console.log(pets.includes('cat'));
// output: true
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