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.
精彩评论