开发者

String case changes

Is there any String manipulation function in Javascript or JQuery for object lower开发者_JAVA技巧casing / uppercasing?

I need to lowercase a string object.


See toLowerCase().


Assuming you mean changing case not cast...

<script type="text/javascript">

var str="Hello World!";
document.write(str.toLowerCase());

</script> 


using jQuery:

 //Lowercase
 $('input#email').val($(this).val().toLowerCase());

 //Uppercase
 $('input#email').val($(this).val().toUpperCase());


"abc".toUpperCase() will give you "ABC", and toLowerCase() works similarly.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜