JSFiddle - React, Tailwind, and code Playground
by lavisha99
HTML
<html>
<head>
blah
</head>
<h1>
gaoga
</h1>
<body>
<p>
lllaaalllaaa
</p>
lala
<br>
<img src="https://media.gettyimages.com/photos/female-tourist-exploring-lush-jungle-lake-surrounded-by-limestone-picture-id637908716" alt="cant load">
</body>
<button>
click here
</button>
</html>
CSS
img[src] { width: 205px; }
JavaScript
function multiply(num1,num2) {
var result = num1 * num2;
return result;
}
alert (multiply(4,7));
var myHeading = document.querySelector('h1');
myHeading.onclick = function() {
var name= prompt('whats yo name boi');
alert('Ouch! Stop poking me! ' + name + ' get out');
}
var myBody= document.querySelector('p');
myBody.onclick = function() { alert ('do not hover here');
}
var myImg = document.querySelector('img');
myImg.onclick = function() {
var Mysrc = myImg.getAttribute('src');
if ( Mysrc === 'https://media.gettyimages.com/photos/female-tourist-exploring-lush-jungle-lake-surrounded-by-limestone-picture-id637908716')
{ myImg.setAttribute ('src', 'https://d2gg9evh47fn9z.cloudfront.net/800px_COLOURBOX1479358.jpg');
}
else { myImg.setAttribute('src', 'https://media.gettyimages.com/photos/female-tourist-exploring-lush-jungle-lake-surrounded-by-limestone-picture-id637908716'); }
}