简体   繁体   English

如何使用JavaScript或jQuery更改SharePoint 2013编辑表单中“保存”和“取消”按钮的背景颜色?

[英]How can I use JavaScript or jQuery to change the background color of the `Save` and `Cancel` buttons in a SharePoint 2013 edit form?

如何使用JavaScript或jQuery更改SharePoint 2013编辑表单中“ Save和“ Cancel按钮的背景颜色?

You can select the required element by value using jQuery 您可以使用jQuery按值选择所需的元素

var submitButton = $("input[value='Submit']"); //use value='Cancel' for cancel button

Add CSS properties using jQuery css() method 使用jQuery css()方法添加CSS属性

submitButton.css("background-color", "green")

Make sure to add reference to the jQuery library file before performing the above operations. 在执行上述操作之前,请确保添加对jQuery库文件的引用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SharePoint 2013-功能区中的“保存”按钮-如果表单无效,则取消保存 - SharePoint 2013 - save button in the ribbon - cancel saving if form not valid 如何使用 JavaScript / jQuery 根据表中的值更改 td 背景颜色? - How can I change td background color depending on value in a table using JavaScript / jQuery? 当按下下一个和上一个按钮时,如何使用javascript和jquery更改文本值? - How can I use javascript and jquery to change a text value when next and previous buttons are pressed? 如何使用javascript更改选择时的标签背景颜色? - How can i Change tab background color on selection using javascript? 如何使用 Javascript 随机更改背景颜色? - How can I change the background color randomly with the Javascript? 如何更改在 javascript 中以.value 结尾的变量的背景颜色 - How can I change the background color of a variable that ends in .value in javascript 如何从 javascript 文件更改背景颜色 - How can i change the background color from a javascript file 如何使用Javascript或jQuery获得背景色? - How can I get the background color using Javascript or jQuery? 如何在没有 Javascript 或 Jquery 的情况下切换背景颜色? - How can I toggle the color of the background without Javascript or Jquery? 如何使用按钮动态更改表单? - How can I use buttons to dynamically change a form?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM