Hi I've tried a few different ways of doing this but nothings working for me, I'm using a system that 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 need to do is change the value of the value from "Logout" to "GO" using jQuery

If someone could help i'd appreciate it I'm starting to pull my hair out now :/ Thanks

有帮助吗?

解决方案

Use this jQuery:

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

OR can use this:

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

Make sure that you are including the JS at right place. means it should be only for this page. If you want to change the Text only this button.

其他提示

This should do the trick for you:

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

jQuery makes it easy to select any element by attribute and alter it accordingly. http://api.jquery.com/attribute-equals-selector/

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

OR

$('input[value=Logout]').val('GO');
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top