Input target value using jquery

Hi, I tried several different ways to do this, but nothing works for me, I use a system in which I cannot physically edit the code I need. I have an input with the following code

<input type="submit" name="ctl10$loginImageButton" value="Logout" id="ctl10_loginImageButton"     class="cssloginImageButtonlogout cssbutton">

And all I have to do is change the value of the value from "Exit" to "GO" using jQuery

If anyone can help, I will be grateful for that. Now I'm starting to pull my hair out: / Thanks

+4
source share
3 answers

Use this jQuery:

$(document).ready(function(){
    $("input[type=submit]").val("Go");
});

OR can use this:

$(document).ready(function(){
    $("#ctl10_loginImageButton").val("Go");
});

, JS . , . .

+3

:

$("input[value='Logout']").val("GO");

jQuery ​​ . http://api.jquery.com/attribute-equals-selector/

+3
$('#ctl10_loginImageButton').val('GO');

OR

$('input[value=Logout]').val('GO');
+1
source

Source: https://habr.com/ru/post/1525041/


All Articles