This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#indexList').children().click(function () { | |
// get the id of the clicked object | |
var myIndex = $(this).attr('id'); | |
// pass the id into custom function which will return the index of the item | |
var itemIndex = getIndexOfItemInList(myIndex); | |
// alert is displaying the item index | |
alert(itemIndex); | |
// THIS IS NOT WORKING | |
$('#itemResult').text('The index of the item is: ' + itemIndex); | |
}); | |
<!-- HTML SNIPPET--> | |
<p id="#itemResult">something</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment