You can define a CSS class with font parameters to be applied, and apply that class programmatically to corresponding element.
.custom {
font-family: Consolas, Courier, monospace;
font-size: small;
}
document.getElementById("myP").className = "custom";