Question

i have a input just like below with asal.html value

<input type="text" id="usernames" name="link_user" class="setinp" value="asal.html" maxlength="80" style="float:right;">

and i want remove .html end of value with jquery onload !

just like :

<input type="text" id="usernames" name="link_user" class="setinp" value="asal" maxlength="80" style="float:right;">

can you help me everyone?! :)

Was it helpful?

Solution

Use .replace:

$('#usernames').val( $('#usernames').val().replace('.html',''));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top