Javascript stack blitz html

Const buttons = Document.QueryselectorAll('. Button')

Const body = document.queryselector('body') 

buttons. forEach(function(button)) {

Console.log(button) ;

Button. Add Event Listner('click', function (Chao) {

Console.log (event. Target) type horhi ha

If(e. Target. I'd === 'grey') {

body. Style. backgroundColor = 'e. target. id;'} 


If(e. Target. I'd === 'yellow') {

body. Style. backgroundColor = 'e. target. id;'} 

If(e. Target. I'd === 'blue') {

body. Style. backgroundColor = 'e. target. id;'} 

If(e. Target. I'd === 'purple') {

body. Style. backgroundColor = 'e. target. id;'} 

<p><label>weight in kg</label><input type = 'text' id='weight' 

<Button >calculate</button>

"Div id =" results"></div>

<p><label>weight in kg</label></p>

Under weight =less than 18.6</p>

<H3>. 


}) 

))} ;


Comments

Popular posts from this blog

Petroleum