1

I just want to pass value of target from script to division tag in mvc. Here are the codes I have done.

Scripts:

@section Scripts{
    <script type="text/javascript">
            $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
                var target = $(e.target).attr("link") // activated tab
                alert(target);
            });
    </script>
}

DIV:(outer division)

<div class="ibox-title">
                    <h5><i class="fa fa-newspaper-o"></i> &nbsp; News &amp; Events</h5>
                    <div class="ibox-tools">
                        <a href="@Url.Action("List","News")" style="color: #00a650;font-weight:600;">View All</a>
                    </div>
                </div>

I just want value of target to display inside this division.

Where: News in @URl.Action("List","News") should be replaced by target's value.

anil shrestha
  • 2,136
  • 2
  • 12
  • 26

1 Answers1

0

Give the div an id then use jQuery.append to add the html:

<div id="Target">
..
..
<b> target </b>
</div>
Johnathan Barclay
  • 18,599
  • 1
  • 22
  • 35