JavaScript image align
WE can assign or read alignment of image by this syntax .
object.align=right;
We can assign left, right , top or bottom align the image. Here is an example
Source code is here
<html>
<head>
<title>Demo of Image align in JavaScript</title>
<script language='JavaScript' type='text/JavaScript'>
<!--
function move_img(str) {
document.getElementById('i1').align=str;
}
//-->
</script>
</head>
<body>
<img src=images/help.jpg id='i1'>
<br><br><br><br>
<input type=button onClick=move_img('left') value='Left'>
<input type=button onClick=move_img('right') value='Right'>
<br><br>
</body>
</html>
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
plus2net.com
|