passing integer to a function in JavaScript

function DisplayMsg(NumVal) {
    if (NumVal == 1) {
       status = "Type your name in the field" ;
    }
    if (NumVal == 2) {
       status = "Type your phone number in the field"
    }
}