I need color the selected row with jquery. Suppose I have a textarea which there are into a line. I need tp color the line that was clicked when the user click on the textaretextarea. soSo I use this code:
$(document).on("mouseup", '#scroll_bar', function(eventData) { console.log("DELLLLLLLLL"); var scrollPosition = $(this).scrollTop() var lineHeight = $(this).css("line-height"); lineHeight = parseInt(lineHeight.substring(0, lineHeight.length - 2)); $(this). var line = Math.floor((eventData.offsetY + scrollPosition) / lineHeight); alert($(this).val().split("\n")[line]); }); But I finefind the line that the user clicked but I don't how selected with a color like orange. Anyone can help me?