Hehe maybe maliit lang to pero sobrang saya ko neto.
<html>
<body>
<p>All has LDF<input type="checkbox"/><br>
Is it Polar Bond?<input type="checkbox" id="polar"/><br>
Does it have Hydrogen bonded with;Flourine;Oxygen;Nitrogen?<input type="checkbox" id="hydro" /><br>
<button id="button" onclick="check()" >Test</button></p>
<script>
function check(){
var a = "It does not have dipole-dipole intermolecular forces" ;
var b = " have a hydrogen bonding" ;
var c = ".It does not" ;
var polar = document.getElementById("polar"); //get polar
var hydro = document.getElementById("hydro"); //get hydro
if (hydro.checked == false && polar.checked == false){ alert("It only has a London Dispersion Force.") }
else{
if (polar.checked == true){
var a = "It has a dipole-dipole intermolecular forces" }; //if polar is checked, change "a" to it has
if (hydro.checked == true){
var b = " hydrogen bonding" } ;
if (a == "It does not have dipole-dipole intermolecular forces"){
var c = " but it has a"} ;
if (a == "It has a dipole-dipole intermolecular forces"){
var c = ". Also it has a" } ;
alert(a+c+b+" and all has London Despersion Force.");
};
};
</script>
Btw beginner pa ako and di ko kinopya ang mga codes para makagawa.
<html>
<body>
<p>All has LDF<input type="checkbox"/><br>
Is it Polar Bond?<input type="checkbox" id="polar"/><br>
Does it have Hydrogen bonded with;Flourine;Oxygen;Nitrogen?<input type="checkbox" id="hydro" /><br>
<button id="button" onclick="check()" >Test</button></p>
<script>
function check(){
var a = "It does not have dipole-dipole intermolecular forces" ;
var b = " have a hydrogen bonding" ;
var c = ".It does not" ;
var polar = document.getElementById("polar"); //get polar
var hydro = document.getElementById("hydro"); //get hydro
if (hydro.checked == false && polar.checked == false){ alert("It only has a London Dispersion Force.") }
else{
if (polar.checked == true){
var a = "It has a dipole-dipole intermolecular forces" }; //if polar is checked, change "a" to it has
if (hydro.checked == true){
var b = " hydrogen bonding" } ;
if (a == "It does not have dipole-dipole intermolecular forces"){
var c = " but it has a"} ;
if (a == "It has a dipole-dipole intermolecular forces"){
var c = ". Also it has a" } ;
alert(a+c+b+" and all has London Despersion Force.");
};
};
</script>
Btw beginner pa ako and di ko kinopya ang mga codes para makagawa.