I want to change the text color of an element when I click a button using jQuery. This code is not working, please help!
$(document).ready(function() {
$("p").click(function() {
$(this).hide();
});
$("button").click(function() {
$("#colorChange").style.color = "blue";
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<p id="colorChange">I should(?) change color when you click mr. button</p>
<button>clickme</button>
$("#colorChange")[0]and your property access would work fine.