Let's say I have this input code below...
<input type="submit" class="btn2" id="btn2" value="btn2" data-key1="fbi" data-key2="cia"/><br>
What I want to do with jQuery is search for both data-key elements, and return their values in an alert box. I've been looking through jQuery's API for assistance in searching attributes, but nothing seems to apply.
This is my latest past without the .click functionality. Any help figuring out how to accomplish this would be appreciated.
Thanks.
$('#data-key').text()
function check () {
var content =
document.getElementById("data-key").innerText;
alert(content);
}
});
});

New Topic/Question
Reply



MultiQuote




|