Skip to content Skip to sidebar Skip to footer

How To Change The Text Color Using Using Jquery

function DoInsert(ind) { var sourceIndex = $('#lstAvailableCode').val(); var targetIndex = $('#lstCodelist').val(); var success = 0;

Solution 1:

$("#lstCodelist").val(x).css("background-color", "#ffffff");

should be

$("#lstCodelist").css("background-color", "#ffffff");

.val() returns a value, not the original jQuery object.

To change the font color, you wold use:

$("#lstCodelist").css("color", "#00ffff");

Solution 2:

                $("#lstCodelist").val(x).css("background-color", "#ffffff");

should be

                $("#lstCodelist").css("background-color", "#ffffff");

Otherwise you're trying to set a css property on whatever string/number the .val() call returns, and NOT on the actual page element that the value's coming from.


Post a Comment for "How To Change The Text Color Using Using Jquery"