Welcome aboard! We are happy you are here and wish you good net-raft!
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<style>
p { background-color: orange; }
</style>
</head>
<body>
<button>Click</button>
<p>Hello jquery!</p>
<script>
$(document).ready(function () {
$.fn.extend({
change_color: function () {
var color = $("p").css('background-color');
if (color === 'rgb(255, 165, 0)') {
$("p").css('background-color', 'green');
}
else {
$("p").css('background-color', 'orange');
}
}
});
$("button").click(function () {
console.log($(this).change_color());
});
});
</script>
</body>
</html>
The most helpful JQUERY solutions
plugin get client ip address using jqueryJQUERY Click to see more ... 10.5K 1.8K