How would you use jQuery to change the value of an object. I have the object and I know the selector, but how would I change the RGB value on click? I'm trying to change the penColor. There are data colors on four list items (yellow, green, blue, orange). So when the user clicks on yellow, the js object changes the object value?
var signaturePad = new SignaturePad(canvas, {
minWidth: 2,
maxWidth: 5,
penColor: "rgb(66, 133, 244)"
});
var selectedColor = $(e.currentTarget).data('color');
$('.initial').css('color', selectedColor);
And here's the markup:
<ul class="global-color">
<li class="yellow-pick" data-color="#f8c90d"></li>
<li class="green-pick" data-color="#3dae49"></li>
<li class="orange-pick" data-color="#e87425"></li>
<li class="blue-pick" data-color="#009cc5"></li>
</ul>