Get the clip property: - Javascript CSS Style Property

Javascript examples for CSS Style Property:clip

Description

Get the clip property:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button type="button" onclick="myFunction()">Return the value of the clip property</button><br>

<img id="myImg" style="position:absolute;clip:rect(0px,60px,200px,0px);" src="http://java2s.com/resources/c.png" width="100" height="132">

<script>
function myFunction() {//from w ww. ja  v  a 2s  .  co m
    console.log(document.getElementById("myImg").style.clip);
}
</script>

</body>
</html>

Related Tutorials