Domanda

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?! :)

È stato utile?

Soluzione

Use .replace:

$('#usernames').val( $('#usernames').val().replace('.html',''));
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top