Web API | DOMRect fromRect property
In Web API there is a DOMRect Interface which has a property fromRect() which creates a DOMRectReadOnly object which has location and dimensions given.
var domRect = DOMRectReadOnly.fromRect(DOMRect object)
It returns an instance of DOMRect
Example: Using fromRect.
Before click the button:
After clicked the button:
- Google Chrome
- Safari 10.1
Attention reader! Don’t stop learning now. Get hold of all the important Comcompetitivepetitve Programming concepts with the Web Design for Beginners | HTML course.