Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Level 11 lesson 8

<!doctype html>
<html>
<head>
<title>Using External JS Library</title>
</head>
<body>
<div id="myDiv">Hello Studytonight!</div>

<script src="https:/code.jquery.com/jquery-3.6.0.min.js">
// change text of div
let div = $("#myDiv").text("Welcome to Studytonight!");
</script>
</body>

</html>
what is the error?
by

1 Answer

kshitijrana14
Try this one: tab one

<!doctype html>
<html>
<head>
<title>Using External JS Library</title>
</head>
<body>
<div id="myDiv">Hello Studytonight!</div>
<script src="USE jquery cdn"></script>
<script >
// change text of div
$("#myDiv").text("Welcome to Studytonight!");
</script>
</body>

</html>

tab two:

let mobiles = ["Apple", "Samsung", "One Plus", "Moto", "Huwaei"];

// using forEach function
mobiles.forEach(printMobs);

// define the callback function
function printMobs(item,index) {
console.log(`Rank ${index}: ${item} Mobiles`);
}

Login / Signup to Answer the Question.