javascript borderWidth property


  Translation results:

UK [ˈbɔ:də widθ] US [ˈbɔrdɚ wɪdθ]

n.Border width

javascript borderWidth propertysyntax

Function:Set the width of all four borders.

Syntax: Object.style.borderWidth=thin|medium|thick|length

##Parameters: thin Define the thin lower border . medium Default. Defines a medium bottom border. thick defines the thick bottom border. length allows you to customize the width of the bottom border.​

javascript borderWidth propertyexample

<html>
<head>
<style type="text/css">
p
{
border: thin solid #FF0000
}
</style>
<script type="text/javascript">
function changeBorderWidth()
{
document.getElementById("p1").style.borderWidth="thick thin";
}
</script>
</head>
<body>

<input type="button" onclick="changeBorderWidth()"
value="Change border widths" />

<p id="p1">This is a paragraph</p>

</body>
</html>

Run instance »

Click the "Run instance" button to view the online instance

Home

Videos

Q&A