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.

4

1 Answer 1

0

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

<div id="Target">
..
..
<b> target </b>
</div>
Sign up to request clarification or add additional context in comments.

1 Comment

Thankyou, answer was satisfactory but there is a little change in question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.