Skip to content

Instantly share code, notes, and snippets.

@pebriana
Created October 18, 2016 04:56
Show Gist options
  • Save pebriana/06465f7c8a0deadc5ed9cc8e3547b14d to your computer and use it in GitHub Desktop.
Save pebriana/06465f7c8a0deadc5ed9cc8e3547b14d to your computer and use it in GitHub Desktop.
jquery id selector wildcard
$(document).ready(function() {
$("[id^=hideshow]").click(function() {
var index = parseInt($(this).attr("id").replace('hideshow',''), 10);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment