Skip to content

Instantly share code, notes, and snippets.

@Mgregchi
Last active October 27, 2021 15:08
Show Gist options
  • Save Mgregchi/fd2796e51c260e9ff99f277ec2f309b9 to your computer and use it in GitHub Desktop.
Save Mgregchi/fd2796e51c260e9ff99f277ec2f309b9 to your computer and use it in GitHub Desktop.
Access and use html elements from a page loaded with JQuery
$(document).ready(function(){
$("#loader").click(function(){
$("#container").load("/jquery-load-shopping-basket/",
function(e){
//Mix
$("empty-basket-search")
.prevObject[0]
.getElementById("empty-basket-search")
.addEventListner("keypress",
function(e){
$("#single-label").text("You've clicked: ".concat(e.keyCode))
})
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment