开发者

String case changes

开发者 https://www.devze.com 2022-12-17 01:59 出处:网络
Is there any String manipulation function in Javascript or JQuery for object lower开发者_JAVA技巧casing / uppercasing?

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

精彩评论

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

关注公众号