use of createElement,innerHTML,appendChild
function book(){
const newRow=document.createElement('tr');
const newTitle=document.createElement('td');
newTitle.innerHTML=title.value;
newRow.appendChild(newTitle);
bookList.appendChild(newRow);
}
use of textContent,value
//message is a span tag/paragraph tag
//weightCalculate/heightCalculate is a input tag
function calculateBMI(){
let height,weight,bmi;
weight=Number(weightCalculate.value);
height=Number(heightCalculate.value);
bmi=weight/(height*0.0254*height*0.0254);
output.textContent=bmi.toFixed(2);
let report= showMessage(bmi);
message.textContent=report;
}
Top comments (0)