6
$('.menu div.profile-btn').on('click', function () {
    $('.mainservice-page').fadeIn(1200);
}

The above script opens the contents of the div .mainservice-page successfully, but I want to open them in a new tab.

How can I do that?

Thanks in advance.

vinoth
  • 75
  • 1
  • 5

1 Answers1

6

You can do like that :

function newWindow_method_1() {
  var wi = window.open();
  var html = $('.mainservice-page').html();
  $(wi.document.body).html(html);
}
OR
function newWindow_method_2() {

  var html = $('.mainservice-page').html();
  window.open(html, "__new", "width=1000,height=1000");

}

$('.menu div.profile-btn').on('click', function () { 
  newWindow_method_1();

 // OR

 // newWindow_method_2();

});

Hope this will help you.

Manoj Srivastava
  • 670
  • 5
  • 16