Issue
I had a checkbox with imbedded attributes. I needed to get these values out of based on a click eventThe key to getting the specified values was the use of the attr method.
<input name="SavePaySchedule" id="SavePaySchedule1" type="checkbox" value="true" selectedscheduleitem="1f3dc523-c466-4dc5-bb52-09848a79c9fd" schedulecountry="44207e0b-d4ca-4bfd-b1b3-2f28a2c6d5ef">
<script type="text/javascript">
$('#SavePaySchedule').click(function (o) {
var $input = $(this);
var scheduleCountry = $input.attr('scheduleCountry');
var selectedScheduleItem = $input.attr('selectedScheduleItem');
var activeState = $input.prop('checked');
});
</script>
No comments:
Post a Comment