Link to home
Start Free TrialLog in
Avatar of swathi ponna
swathi ponna

asked on

MVC JQUERY

In response i have data as below:
<!DOCTYPE html>
<html>
<head>
<body>
.............
<div id="divtag">
                   
<table id='tblMainResult' width='100%' style='border: 0.5px solid #999999;' class='UploadAdjustmentTable'><tr style='height: 40px;'><td width='100%'><strong style='font-size: 12pt;'> XML Validation Results for: 30-Aug-2019</strong><br /><br /></td></tr><tr style='background-color: lightgray; height: 25px;'><td width='100%'><strong>Validate Presence of all 10 reports in XML </strong> </td></tr><tr><td width='100%' align='left' valign='top'><br /> Check 1:-Confirm XML contains 10 reports - <span style='color:green; font-weight: bold'>PASS </span><BR/><br /></td></tr><tr style='background-color: lightgray; height: 25px;'><td  width='100%'>
..........................
</td></tr></table></div><br /></td></tr><tr><td><br /> </td></tr>
</table>
</div>
...................
</body>
</head>
</html>

how to display only <div id="divtag"> content on page?


i need to display below after  success: function (response) { line?

   $.ajax({
                    url: '@Url.Action("CreateAndSubmitXML", "ExternalSubmission")',
                    data: JSON.stringify({
                        SelectedBusinessDate: selectedCobDate,
                        SelectedBusinessName: businessDatesText,
                        Reason: adjComments
                    }),
                    type: 'POST',
                    datatype: 'json',
                    contentType: 'application/json; charset=utf-8',
                    success: function (response) {
Avatar of leakim971
leakim971
Flag of Guadeloupe image

success: function (response) {
     // YOU DID NOT POST HOW YOU PUT THE CONTENT IN THE PAGE....

Open in new window

Check this : https://api.jquery.com/siblings/
$("#divtag").siblings().hide();

Open in new window

Use show/hide method:
 success: function (response) {
        $("#divtag").show();
//what exactly are you trying to hide if it is the table contents please specify condition using jquery and use hide method.
}

Open in new window

This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.