-4

Suppose I have a code like below:

<a  href="modals/w4_ag_GiftServicesTemplate_MODAL_v1.html" >Activate Modal</a>

Now i want to get an element of the html (w4_ag_GiftServicesTemplate_MODAL_v1.html) within the calling html. Actually The href html will be displayed as Popup and I want to add a class on that html dynamically.

bappa147
  • 519
  • 3
  • 8
  • 18
  • You should give an example of what you actually want to include in your page. Then, you should give some details. Is the target html under your control??? – Pantelis Natsiavas Jan 09 '14 at 06:39

1 Answers1

0

First make an ajax request and get the contents of the second html page.

$.ajax({
url: 'ajax/test.html',
dataType: 'html',
success: function(data) {
  $('#html_content').html(data);
}

});

Now inside your html page include a div with id 'html_content'

<div id='html_content'></div>
JTN
  • 229
  • 5
  • 13