how to add border to a text in html with javascript

JavaScript
document.getElementById("myDiv").style.border = "thick solid #0000FF"; border-style: /*Style Prefered*/;

/*Styles can be:

dotted
dashed
solid
double
groove
ridge
inset
outset
nonce
hidden

*/
Source

Also in JavaScript: