开发者

javascript object value to string conversion

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜