Question: Can u do a code like this in java ? HTML Document Your browser does not support the audio element. -------------------------------------------------------------------------------------- css: * { margin:
Can u do a code like this in java ? HTML
Your browser does not support the audio element.
--------------------------------------------------------------------------------------
css:
* {
margin: 0;
padding: 0;
}
body {
background: #cccccc;
}
#cow {
position: absolute;
width: 50px;
height: 50px;
background: #cccccc;
}
---------------------------------------------------------------
script:
$().ready(function() {
var docHeight = $(document).height(),
docWidth = $(document).width(),
$div = $('#cow'),
divWidth = $div.width(),
divHeight = $div.height(),
heightMax = docHeight - divHeight,
widthMax = docWidth - divWidth;
$div.css({
left: Math.floor(Math.random() * widthMax),
top: Math.floor(Math.random() * heightMax)
});
$('#cow').click(showcow);
});
function showcow() {
$('#cow').html("");
$('#cow').html("")
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
