I am getting the value of input using javascript using below code.
var name=document.getElementById("firstName").value;
Getting outp开发者_JS百科ut like rk-chaitu.I want to split this output using reg expression.
Now my question is how to convert name object to String?
Regards,
Chaitu
name
should already be a string. You can directly use name.split(separator)
.
EDIT: I see you have added information. Can you post more code? Perhaps the error comes from something else.
The value attribute should already be a String.
精彩评论