HTML DOM Image border properties
Definition and Usage
border property sets or returns the picture border property values.
border attribute specifies the width of the border around the image.
Note: By default image has no border (unless image itself comes border).
grammar
imageObject.border=pixels
Browser Support
All major browsers support border properties
Examples
Examples
Add a picture frame:
<html>
<head>
<script>
function addBorder()
{
document.getElementById("compman").border="2";
}
</script>
</head>
<body>
<img id="compman" src="compman.gif" alt="Computerman">
<br><br>
<input type="button" onclick="addBorder()" value="Add border">
</body>
</html>
<head>
<script>
function addBorder()
{
document.getElementById("compman").border="2";
}
</script>
</head>
<body>
<img id="compman" src="compman.gif" alt="Computerman">
<br><br>
<input type="button" onclick="addBorder()" value="Add border">
</body>
</html>
try it"
Image Object