如何使用jquery或javascript更改以下按钮的值?
我有两个这样的按钮:如何使用jquery或javascript更改以下按钮的值?,javascript,jquery,Javascript,Jquery,我有两个这样的按钮: <button class="next_prev" onclick="" id="first_button" disabled>{{ pages.first }}</button> <button class="next_prev" onclick="" id="last_button" disabled>{{ pages.last }}</button> {{pages.first} {{pages.last} 它们显
<button class="next_prev" onclick="" id="first_button" disabled>{{ pages.first }}</button>
<button class="next_prev" onclick="" id="last_button" disabled>{{ pages.last }}</button>
{{pages.first}
{{pages.last}
它们显示第一个和最后一个按钮作为页码。i、 e 1或5。按钮总是有值的。我想将它们的值替换为:|
|
代表最后一个。我该怎么做呢?试试这个:
$('#first_button').html('new_name1');
$('#last_button').html('new_name2');
使用下面的
HTML ASCII
代码,并使用.HTML()
将其添加为HTML
$("#first_button").html('| <');
$("#last_button").html('> |');
|代码>用于|
用于
对于完整列表$('button#first_button').val('|以便更改button?@amrendrat的innerhtml在我的同一html文档中有相同的四个按钮,具有相同的id,但它仅对其中两个按钮起作用。怎么了?
$("#first_button").html('| <');
$("#last_button").html('> |');