Is there a way to turn the code for each button on my website into a jQuery function that can be applied to any button?
This is how the code currently appears:
$(document).ready(function() {
$("#linkXML").hover(
function() {
$("#linkXML").css({
"-webkit-box-shadow": "inset 0px 0px 98px -34px rgba(51,173,255,0.79)",
"-moz-box-shadow": "inset 0px 0px 98px -34px rgba(51,173,255,0.79)",
"box-shadow": "inset 0px 0px 98px -34px rgba(51,173,255,0.79)"
});
},
function() {
$("#linkXML").css({
"-webkit-box-shadow": "",
"-moz-box-shadow": "",
"box-shadow": ""
});
}
);
});
Currently, I'm copying and pasting this code for every button and just changing the element it's called upon.
I would appreciate it if you could advise me on how to create a single function that can be applied to any element to trigger this behavior.