Reputation: 873
I have 2 pages, for example
index.html
remote-content.html
in Index.html
<a class="btn btn-primary" href="/List/remote-content.html" data-controlId="AccountId" data-toggle="modal" data-target="#modal" type="button"><i class="fa fa-search"></i></a>
How can I access data-controlId="AccountId"
from remote-content.html
when modal when loaded?
Upvotes: 0
Views: 108
Reputation: 873
Can I access this way.
$(document).ready(function () {
var controlId = $("#button", parent.document).attr("data-controlId");
});
Upvotes: 1
Reputation: 332
Using jQuery, you can access data-
attributes with the .data()
method on a jQuery object.
Upvotes: 1