I'm building a dropdown menu, and I want to select any of the lis from the parent element of ul when clicked. Then, take that text and change the "Work Inquiry" (text of #subject) text w/ selected menu item text.
I have comments explaining my predicament on the fiddle.
Here is the jsFiddle :: http://jsfiddle.net/8m4Tj/
$("ul#subjects > li").on("click", function () {
$("#subjects").slideUp(210);
var liText = $(this).text();
var newSubjectText = $("#subject").text();
alert(liText); // this alerts selected item... how do you change #subject.text ???
alert(newSubjectText); // stays the same
});
I don't know if im selecting the wrong item, but I want to replace the data-value and the actual text value. I'm doing this method since there are no easy ways of styling the <select> element.