5. <body>
<p id=“SCCI">Seek the peak</p>
<script>
document.getElementById(“SCCI").innerHTML =
“Be your own hero";
</script>
</body>
Changing HTML Elements using JS
7. Pop up code
function div_show() {
document.getElementById(‘id').style.display = "block";
}
function div_hide(){
document.getElementById(‘id').style.display = "none";
}
8.
9. Validation in JS
function check_empty() {
if (document.getElementById('name').value == "" ||
document.getElementById('email').value == "" ||
document.getElementById('msg').value == "") {
alert("Fill All Fields !");
} else {
document.getElementById('form').submit();
alert("Form Submitted Successfully...");
}
}
12. How to connect to a
DATABASE?
<?php
$conn = mysqli_connect("localhost", "root", "",
"devology");
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
?>