我在一个id为'product_form'的div中有一个类'可伸缩'的按钮,我想更改该按钮中的span的文本,我有以下jQuery脚本来获得我想要的。
<form id='product_form'>
<button class='scalable' name='submit'>
<span>old Text</span>
</button>
</form>
我想使用表单ID将按钮中的文本“旧文本”更改为按钮内的“新文本”,我希望使用原型执行相同操作。
这是jQuery等效代码:
jQuery('#product_form button.scalable span').text('new text');
但我没有jQuery,我想在原型中执行相同的任务。
请在原型中建议我上面的等效代码。
感谢。