Am I able to get the css class name of an OPTION element, and then add it to an input field with jQuery?
I have this now:
var classChecker = $('#amount').attr('class');
$("#classBox").html("<b>$</b> " +
classChecker);
Although this just gives me: $ undefined
You can use the following to get the class of an element:
(You can use either .attr() or .prop() to accomplish this)
If you wanted to automate this, such as adding it to an input upon selection:
Working Example