How to show the bootstrap popup after click on link

Hi,

I did everything as show in this video: https://www.youtube.com/watch?v=aUAUsADp9ao

And when I am using a button it works fine.

But I need to use a link (a href) and this is my code:


<?= Html::a(Html::tag('div', '', ['class'=> ['opt', 'opt_1']]), ['site/login'], ['id'=>'notlogin']); ?>

javascript (I changed “value” to “href” and it still doesn’t work):


$(function(){

	$('#notlogin').click(function (){

		$('#modal').modal('show')

		.find('#notloginContent')

		.load($(this).attr('href'));

	});

});


<?php

	Modal::begin([

	'header' => '<h4>Not logged</h4>',

	'id' => 'modal',

	'size' => 'modal-md',

	]);

	

	echo '<div id="notloginContent"></div>';

	Modal::end();

?>

Hi,

Refer this link, this may help you

YII WIKI

hai i am new to yii framework…
i didn’t get a link… i need to open modal popup when click anchor tag and need to pass data also in a…
my code

<?= Html::a("Edit", ['edit', 'ssid' => $field->sid],['class'=>'btn btn-success']); ?>

Modal::begin([

  'header'=>'<h4>Student Registration</h4>',

  'id'=>'modal',

  'size'=>'modal-lg',

  ]);

  echo "<div id='modalContent'></div>";

  Modal::end();

please guide me how to do this… thank you …