JavaScript – Change the Border Radius of HTML Element

To change the border radius of a HTML Element using JavaScript, get reference to this HTML element, and assign required border radius value to the element.style.borderRadius property.

In the following example, we will change the border radius of HTML Element with id "myElement" to "10px", in JavaScript, using element.style.borderRadius property.

example.html

ADVERTISEMENT

Conclusion

In this JavaScript Tutorial, we learned how to change the border radius of a HTML Element using JavaScript.