开发者

javascript object value to string conversion

开发者 https://www.devze.com 2023-02-24 17:19 出处:网络
I am getting the value of input using javascript using below code. var name=document.getElementById(\"firstName\").value;

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

精彩评论

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