skip div section when it is display none while displaying html content Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!How to disable all div contentHTML-encoding lost when attribute read from input fieldLabel fires click function twiceUse jQuery to hide a DIV when the user clicks outside of itPrint the contents of a DIVJquery flowplayer - tabs - content inside div tags not displayingHow to change css display none or block property using Jquery?.hide() or display: none? jQuerytd loses ext file style settings after jQuery display:none then display:tableSet margin between col-md-* div classes without harming responsiveness of page
How does TikZ render an arc?
Did pre-Columbian Americans know the spherical shape of the Earth?
How could a hydrazine and N2O4 cloud (or it's reactants) show up in weather radar?
Where and when has Thucydides been studied?
3D Masyu - A Die
Was the pager message from Nick Fury to Captain Marvel unnecessary?
Found this skink in my tomato plant bucket. Is he trapped? Or could he leave if he wanted?
Did John Wesley plagiarize Matthew Henry...?
Does the universe have a fixed centre of mass?
One-one communication
Is the Mordenkainens' Sword spell underpowered?
Can gravitational waves pass through a black hole?
Derived column in a data extension
My mentor says to set image to Fine instead of RAW — how is this different from JPG?
What was the last profitable war?
Pointing to problems without suggesting solutions
Does the main washing effect of soap come from foam?
Why is there so little support for joining EFTA in the British parliament?
By what mechanism was the 2017 UK General Election called?
How to ask rejected full-time candidates to apply to teach individual courses?
NIntegrate on a solution of a matrix ODE
latest version of QGIS fails to edit attribute table of GeoJSON file
.bashrc alias for a command with fixed second parameter
How to make triangles with rounded sides and corners? (squircle with 3 sides)
skip div section when it is display none while displaying html content
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!How to disable all div contentHTML-encoding lost when attribute read from input fieldLabel fires click function twiceUse jQuery to hide a DIV when the user clicks outside of itPrint the contents of a DIVJquery flowplayer - tabs - content inside div tags not displayingHow to change css display none or block property using Jquery?.hide() or display: none? jQuerytd loses ext file style settings after jQuery display:none then display:tableSet margin between col-md-* div classes without harming responsiveness of page
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am looping through html content and displaying in other table. while reading, if div element is display:none then i want to skip the entire div section.
in the below example, need to hide "Property size, 100" row.
Please let me know the best option.
thanks you so much.
Surya.
$('#tblWorksheet tbody').empty();
var tdworksheet;
$('#Worksheet label, #Worksheet input, #Worksheet select').each(function(index, element) // context is
var theTag = this.tagName;
var TF;
if($(this).parent().get( 0 ).tagName == 'DIV' )
//hide entire div section
if (theTag == "LABEL")
theValue = $(this).attr('title')
if (theValue != null)
tdworksheet += "<tr><td class='col-sm-2'><b>" + theValue + "</b></td>>"
else if (theTag == "INPUT" && this.type == 'text')
theValue = $(this).val();
if (theValue != null)
tdworksheet += "<td class='col-sm-2'><b>" + theValue + "</b></td></tr>"
);
$('#tblWorksheet tbody').append(tdworksheet);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table id="tblWorksheet" border=1>
<tbody></tbody>
</table>
<div id="Worksheet" class="divparent">
<div>
<p class="text-info" style="margin-left:10px;">
Please enter the following deck information.
</p>
</div>
<div class="row" id="divProp" style="display:none;">
<div class=" col-md-5 text-right">
<label title="Property Size">Property Size</label>
</div>
<div class="col-sm-4 text-left">
<input class="form-control" id="propsize" name="PropSize" type="text" value="100" />
</div>
</div>
<div class="row" id="divWorkType">
<div class="col-md-5 text-right">
<label id="lblWorkType" title="WorkType">Work Type</label>
</div>
<div class="col-sm-4 text-left">
<input Value="DISTURB" class="form-control" disabled="True" id="WORKTYPE" name="WORKTYPE" type="text" value="" />
</div>
</div>
</div>
jquery
add a comment |
I am looping through html content and displaying in other table. while reading, if div element is display:none then i want to skip the entire div section.
in the below example, need to hide "Property size, 100" row.
Please let me know the best option.
thanks you so much.
Surya.
$('#tblWorksheet tbody').empty();
var tdworksheet;
$('#Worksheet label, #Worksheet input, #Worksheet select').each(function(index, element) // context is
var theTag = this.tagName;
var TF;
if($(this).parent().get( 0 ).tagName == 'DIV' )
//hide entire div section
if (theTag == "LABEL")
theValue = $(this).attr('title')
if (theValue != null)
tdworksheet += "<tr><td class='col-sm-2'><b>" + theValue + "</b></td>>"
else if (theTag == "INPUT" && this.type == 'text')
theValue = $(this).val();
if (theValue != null)
tdworksheet += "<td class='col-sm-2'><b>" + theValue + "</b></td></tr>"
);
$('#tblWorksheet tbody').append(tdworksheet);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table id="tblWorksheet" border=1>
<tbody></tbody>
</table>
<div id="Worksheet" class="divparent">
<div>
<p class="text-info" style="margin-left:10px;">
Please enter the following deck information.
</p>
</div>
<div class="row" id="divProp" style="display:none;">
<div class=" col-md-5 text-right">
<label title="Property Size">Property Size</label>
</div>
<div class="col-sm-4 text-left">
<input class="form-control" id="propsize" name="PropSize" type="text" value="100" />
</div>
</div>
<div class="row" id="divWorkType">
<div class="col-md-5 text-right">
<label id="lblWorkType" title="WorkType">Work Type</label>
</div>
<div class="col-sm-4 text-left">
<input Value="DISTURB" class="form-control" disabled="True" id="WORKTYPE" name="WORKTYPE" type="text" value="" />
</div>
</div>
</div>
jquery
Hint: Use api.jquery.com/css to read the current display status of an element
– ADyson
Mar 22 at 12:48
add a comment |
I am looping through html content and displaying in other table. while reading, if div element is display:none then i want to skip the entire div section.
in the below example, need to hide "Property size, 100" row.
Please let me know the best option.
thanks you so much.
Surya.
$('#tblWorksheet tbody').empty();
var tdworksheet;
$('#Worksheet label, #Worksheet input, #Worksheet select').each(function(index, element) // context is
var theTag = this.tagName;
var TF;
if($(this).parent().get( 0 ).tagName == 'DIV' )
//hide entire div section
if (theTag == "LABEL")
theValue = $(this).attr('title')
if (theValue != null)
tdworksheet += "<tr><td class='col-sm-2'><b>" + theValue + "</b></td>>"
else if (theTag == "INPUT" && this.type == 'text')
theValue = $(this).val();
if (theValue != null)
tdworksheet += "<td class='col-sm-2'><b>" + theValue + "</b></td></tr>"
);
$('#tblWorksheet tbody').append(tdworksheet);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table id="tblWorksheet" border=1>
<tbody></tbody>
</table>
<div id="Worksheet" class="divparent">
<div>
<p class="text-info" style="margin-left:10px;">
Please enter the following deck information.
</p>
</div>
<div class="row" id="divProp" style="display:none;">
<div class=" col-md-5 text-right">
<label title="Property Size">Property Size</label>
</div>
<div class="col-sm-4 text-left">
<input class="form-control" id="propsize" name="PropSize" type="text" value="100" />
</div>
</div>
<div class="row" id="divWorkType">
<div class="col-md-5 text-right">
<label id="lblWorkType" title="WorkType">Work Type</label>
</div>
<div class="col-sm-4 text-left">
<input Value="DISTURB" class="form-control" disabled="True" id="WORKTYPE" name="WORKTYPE" type="text" value="" />
</div>
</div>
</div>
jquery
I am looping through html content and displaying in other table. while reading, if div element is display:none then i want to skip the entire div section.
in the below example, need to hide "Property size, 100" row.
Please let me know the best option.
thanks you so much.
Surya.
$('#tblWorksheet tbody').empty();
var tdworksheet;
$('#Worksheet label, #Worksheet input, #Worksheet select').each(function(index, element) // context is
var theTag = this.tagName;
var TF;
if($(this).parent().get( 0 ).tagName == 'DIV' )
//hide entire div section
if (theTag == "LABEL")
theValue = $(this).attr('title')
if (theValue != null)
tdworksheet += "<tr><td class='col-sm-2'><b>" + theValue + "</b></td>>"
else if (theTag == "INPUT" && this.type == 'text')
theValue = $(this).val();
if (theValue != null)
tdworksheet += "<td class='col-sm-2'><b>" + theValue + "</b></td></tr>"
);
$('#tblWorksheet tbody').append(tdworksheet);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table id="tblWorksheet" border=1>
<tbody></tbody>
</table>
<div id="Worksheet" class="divparent">
<div>
<p class="text-info" style="margin-left:10px;">
Please enter the following deck information.
</p>
</div>
<div class="row" id="divProp" style="display:none;">
<div class=" col-md-5 text-right">
<label title="Property Size">Property Size</label>
</div>
<div class="col-sm-4 text-left">
<input class="form-control" id="propsize" name="PropSize" type="text" value="100" />
</div>
</div>
<div class="row" id="divWorkType">
<div class="col-md-5 text-right">
<label id="lblWorkType" title="WorkType">Work Type</label>
</div>
<div class="col-sm-4 text-left">
<input Value="DISTURB" class="form-control" disabled="True" id="WORKTYPE" name="WORKTYPE" type="text" value="" />
</div>
</div>
</div>
$('#tblWorksheet tbody').empty();
var tdworksheet;
$('#Worksheet label, #Worksheet input, #Worksheet select').each(function(index, element) // context is
var theTag = this.tagName;
var TF;
if($(this).parent().get( 0 ).tagName == 'DIV' )
//hide entire div section
if (theTag == "LABEL")
theValue = $(this).attr('title')
if (theValue != null)
tdworksheet += "<tr><td class='col-sm-2'><b>" + theValue + "</b></td>>"
else if (theTag == "INPUT" && this.type == 'text')
theValue = $(this).val();
if (theValue != null)
tdworksheet += "<td class='col-sm-2'><b>" + theValue + "</b></td></tr>"
);
$('#tblWorksheet tbody').append(tdworksheet);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table id="tblWorksheet" border=1>
<tbody></tbody>
</table>
<div id="Worksheet" class="divparent">
<div>
<p class="text-info" style="margin-left:10px;">
Please enter the following deck information.
</p>
</div>
<div class="row" id="divProp" style="display:none;">
<div class=" col-md-5 text-right">
<label title="Property Size">Property Size</label>
</div>
<div class="col-sm-4 text-left">
<input class="form-control" id="propsize" name="PropSize" type="text" value="100" />
</div>
</div>
<div class="row" id="divWorkType">
<div class="col-md-5 text-right">
<label id="lblWorkType" title="WorkType">Work Type</label>
</div>
<div class="col-sm-4 text-left">
<input Value="DISTURB" class="form-control" disabled="True" id="WORKTYPE" name="WORKTYPE" type="text" value="" />
</div>
</div>
</div>
$('#tblWorksheet tbody').empty();
var tdworksheet;
$('#Worksheet label, #Worksheet input, #Worksheet select').each(function(index, element) // context is
var theTag = this.tagName;
var TF;
if($(this).parent().get( 0 ).tagName == 'DIV' )
//hide entire div section
if (theTag == "LABEL")
theValue = $(this).attr('title')
if (theValue != null)
tdworksheet += "<tr><td class='col-sm-2'><b>" + theValue + "</b></td>>"
else if (theTag == "INPUT" && this.type == 'text')
theValue = $(this).val();
if (theValue != null)
tdworksheet += "<td class='col-sm-2'><b>" + theValue + "</b></td></tr>"
);
$('#tblWorksheet tbody').append(tdworksheet);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table id="tblWorksheet" border=1>
<tbody></tbody>
</table>
<div id="Worksheet" class="divparent">
<div>
<p class="text-info" style="margin-left:10px;">
Please enter the following deck information.
</p>
</div>
<div class="row" id="divProp" style="display:none;">
<div class=" col-md-5 text-right">
<label title="Property Size">Property Size</label>
</div>
<div class="col-sm-4 text-left">
<input class="form-control" id="propsize" name="PropSize" type="text" value="100" />
</div>
</div>
<div class="row" id="divWorkType">
<div class="col-md-5 text-right">
<label id="lblWorkType" title="WorkType">Work Type</label>
</div>
<div class="col-sm-4 text-left">
<input Value="DISTURB" class="form-control" disabled="True" id="WORKTYPE" name="WORKTYPE" type="text" value="" />
</div>
</div>
</div>
jquery
jquery
asked Mar 22 at 12:42
user18046user18046
206
206
Hint: Use api.jquery.com/css to read the current display status of an element
– ADyson
Mar 22 at 12:48
add a comment |
Hint: Use api.jquery.com/css to read the current display status of an element
– ADyson
Mar 22 at 12:48
Hint: Use api.jquery.com/css to read the current display status of an element
– ADyson
Mar 22 at 12:48
Hint: Use api.jquery.com/css to read the current display status of an element
– ADyson
Mar 22 at 12:48
add a comment |
2 Answers
2
active
oldest
votes
You can check visibility of a div using jQuery's .is()
combined with the :visible
selector. It looks like you also want to make sure it's a div, so your conditional would be something like this:
var $parent = $(this).parent();
if($parent.is('div') && !$parent.is(':visible'))
return true; // continue to next loop iteration
You are Awesome!
– user18046
Mar 22 at 16:39
add a comment |
Here the completed code.
$('#tblWorksheet tbody').empty();
var tdworksheet;
$('#Worksheet label, #Worksheet input, #Worksheet select').each(function(index, element) // context is
var theTag = this.tagName;
var TF;
if($(this).parent().is('div') && !$(this).parent().is(':visible'))
return true;
if (theTag == "LABEL")
theValue = $(this).attr('title')
if (theValue != null)
tdworksheet += "<tr><td class='col-sm-2'><b>" + theValue + "</b></td>>"
else if (theTag == "INPUT" && this.type == 'text')
theValue = $(this).val();
if (theValue != null)
tdworksheet += "<td class='col-sm-2'><b>" + theValue + "</b></td></tr>"
);
$('#tblWorksheet tbody').append(tdworksheet);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table id="tblWorksheet" border=1>
<tbody></tbody>
</table>
<div id="Worksheet" class="divparent">
<div>
<p class="text-info" style="margin-left:10px;">
Please enter the following deck information.
</p>
</div>
<div class="row" id="divProp" style="display:none;">
<div class=" col-md-5 text-right">
<label title="Property Size">Property Size</label>
</div>
<div class="col-sm-4 text-left">
<input class="form-control" id="propsize" name="PropSize" type="text" value="100" />
</div>
</div>
<div class="row" id="divWorkType">
<div class="col-md-5 text-right">
<label id="lblWorkType" title="WorkType">Work Type</label>
</div>
<div class="col-sm-4 text-left">
<input Value="DISTURB" class="form-control" disabled="True" id="WORKTYPE" name="WORKTYPE" type="text" value="" />
</div>
</div>
</div>
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55299874%2fskip-div-section-when-it-is-display-none-while-displaying-html-content%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can check visibility of a div using jQuery's .is()
combined with the :visible
selector. It looks like you also want to make sure it's a div, so your conditional would be something like this:
var $parent = $(this).parent();
if($parent.is('div') && !$parent.is(':visible'))
return true; // continue to next loop iteration
You are Awesome!
– user18046
Mar 22 at 16:39
add a comment |
You can check visibility of a div using jQuery's .is()
combined with the :visible
selector. It looks like you also want to make sure it's a div, so your conditional would be something like this:
var $parent = $(this).parent();
if($parent.is('div') && !$parent.is(':visible'))
return true; // continue to next loop iteration
You are Awesome!
– user18046
Mar 22 at 16:39
add a comment |
You can check visibility of a div using jQuery's .is()
combined with the :visible
selector. It looks like you also want to make sure it's a div, so your conditional would be something like this:
var $parent = $(this).parent();
if($parent.is('div') && !$parent.is(':visible'))
return true; // continue to next loop iteration
You can check visibility of a div using jQuery's .is()
combined with the :visible
selector. It looks like you also want to make sure it's a div, so your conditional would be something like this:
var $parent = $(this).parent();
if($parent.is('div') && !$parent.is(':visible'))
return true; // continue to next loop iteration
answered Mar 22 at 12:49
jbyrdjbyrd
2,20542857
2,20542857
You are Awesome!
– user18046
Mar 22 at 16:39
add a comment |
You are Awesome!
– user18046
Mar 22 at 16:39
You are Awesome!
– user18046
Mar 22 at 16:39
You are Awesome!
– user18046
Mar 22 at 16:39
add a comment |
Here the completed code.
$('#tblWorksheet tbody').empty();
var tdworksheet;
$('#Worksheet label, #Worksheet input, #Worksheet select').each(function(index, element) // context is
var theTag = this.tagName;
var TF;
if($(this).parent().is('div') && !$(this).parent().is(':visible'))
return true;
if (theTag == "LABEL")
theValue = $(this).attr('title')
if (theValue != null)
tdworksheet += "<tr><td class='col-sm-2'><b>" + theValue + "</b></td>>"
else if (theTag == "INPUT" && this.type == 'text')
theValue = $(this).val();
if (theValue != null)
tdworksheet += "<td class='col-sm-2'><b>" + theValue + "</b></td></tr>"
);
$('#tblWorksheet tbody').append(tdworksheet);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table id="tblWorksheet" border=1>
<tbody></tbody>
</table>
<div id="Worksheet" class="divparent">
<div>
<p class="text-info" style="margin-left:10px;">
Please enter the following deck information.
</p>
</div>
<div class="row" id="divProp" style="display:none;">
<div class=" col-md-5 text-right">
<label title="Property Size">Property Size</label>
</div>
<div class="col-sm-4 text-left">
<input class="form-control" id="propsize" name="PropSize" type="text" value="100" />
</div>
</div>
<div class="row" id="divWorkType">
<div class="col-md-5 text-right">
<label id="lblWorkType" title="WorkType">Work Type</label>
</div>
<div class="col-sm-4 text-left">
<input Value="DISTURB" class="form-control" disabled="True" id="WORKTYPE" name="WORKTYPE" type="text" value="" />
</div>
</div>
</div>
add a comment |
Here the completed code.
$('#tblWorksheet tbody').empty();
var tdworksheet;
$('#Worksheet label, #Worksheet input, #Worksheet select').each(function(index, element) // context is
var theTag = this.tagName;
var TF;
if($(this).parent().is('div') && !$(this).parent().is(':visible'))
return true;
if (theTag == "LABEL")
theValue = $(this).attr('title')
if (theValue != null)
tdworksheet += "<tr><td class='col-sm-2'><b>" + theValue + "</b></td>>"
else if (theTag == "INPUT" && this.type == 'text')
theValue = $(this).val();
if (theValue != null)
tdworksheet += "<td class='col-sm-2'><b>" + theValue + "</b></td></tr>"
);
$('#tblWorksheet tbody').append(tdworksheet);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table id="tblWorksheet" border=1>
<tbody></tbody>
</table>
<div id="Worksheet" class="divparent">
<div>
<p class="text-info" style="margin-left:10px;">
Please enter the following deck information.
</p>
</div>
<div class="row" id="divProp" style="display:none;">
<div class=" col-md-5 text-right">
<label title="Property Size">Property Size</label>
</div>
<div class="col-sm-4 text-left">
<input class="form-control" id="propsize" name="PropSize" type="text" value="100" />
</div>
</div>
<div class="row" id="divWorkType">
<div class="col-md-5 text-right">
<label id="lblWorkType" title="WorkType">Work Type</label>
</div>
<div class="col-sm-4 text-left">
<input Value="DISTURB" class="form-control" disabled="True" id="WORKTYPE" name="WORKTYPE" type="text" value="" />
</div>
</div>
</div>
add a comment |
Here the completed code.
$('#tblWorksheet tbody').empty();
var tdworksheet;
$('#Worksheet label, #Worksheet input, #Worksheet select').each(function(index, element) // context is
var theTag = this.tagName;
var TF;
if($(this).parent().is('div') && !$(this).parent().is(':visible'))
return true;
if (theTag == "LABEL")
theValue = $(this).attr('title')
if (theValue != null)
tdworksheet += "<tr><td class='col-sm-2'><b>" + theValue + "</b></td>>"
else if (theTag == "INPUT" && this.type == 'text')
theValue = $(this).val();
if (theValue != null)
tdworksheet += "<td class='col-sm-2'><b>" + theValue + "</b></td></tr>"
);
$('#tblWorksheet tbody').append(tdworksheet);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table id="tblWorksheet" border=1>
<tbody></tbody>
</table>
<div id="Worksheet" class="divparent">
<div>
<p class="text-info" style="margin-left:10px;">
Please enter the following deck information.
</p>
</div>
<div class="row" id="divProp" style="display:none;">
<div class=" col-md-5 text-right">
<label title="Property Size">Property Size</label>
</div>
<div class="col-sm-4 text-left">
<input class="form-control" id="propsize" name="PropSize" type="text" value="100" />
</div>
</div>
<div class="row" id="divWorkType">
<div class="col-md-5 text-right">
<label id="lblWorkType" title="WorkType">Work Type</label>
</div>
<div class="col-sm-4 text-left">
<input Value="DISTURB" class="form-control" disabled="True" id="WORKTYPE" name="WORKTYPE" type="text" value="" />
</div>
</div>
</div>
Here the completed code.
$('#tblWorksheet tbody').empty();
var tdworksheet;
$('#Worksheet label, #Worksheet input, #Worksheet select').each(function(index, element) // context is
var theTag = this.tagName;
var TF;
if($(this).parent().is('div') && !$(this).parent().is(':visible'))
return true;
if (theTag == "LABEL")
theValue = $(this).attr('title')
if (theValue != null)
tdworksheet += "<tr><td class='col-sm-2'><b>" + theValue + "</b></td>>"
else if (theTag == "INPUT" && this.type == 'text')
theValue = $(this).val();
if (theValue != null)
tdworksheet += "<td class='col-sm-2'><b>" + theValue + "</b></td></tr>"
);
$('#tblWorksheet tbody').append(tdworksheet);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table id="tblWorksheet" border=1>
<tbody></tbody>
</table>
<div id="Worksheet" class="divparent">
<div>
<p class="text-info" style="margin-left:10px;">
Please enter the following deck information.
</p>
</div>
<div class="row" id="divProp" style="display:none;">
<div class=" col-md-5 text-right">
<label title="Property Size">Property Size</label>
</div>
<div class="col-sm-4 text-left">
<input class="form-control" id="propsize" name="PropSize" type="text" value="100" />
</div>
</div>
<div class="row" id="divWorkType">
<div class="col-md-5 text-right">
<label id="lblWorkType" title="WorkType">Work Type</label>
</div>
<div class="col-sm-4 text-left">
<input Value="DISTURB" class="form-control" disabled="True" id="WORKTYPE" name="WORKTYPE" type="text" value="" />
</div>
</div>
</div>
$('#tblWorksheet tbody').empty();
var tdworksheet;
$('#Worksheet label, #Worksheet input, #Worksheet select').each(function(index, element) // context is
var theTag = this.tagName;
var TF;
if($(this).parent().is('div') && !$(this).parent().is(':visible'))
return true;
if (theTag == "LABEL")
theValue = $(this).attr('title')
if (theValue != null)
tdworksheet += "<tr><td class='col-sm-2'><b>" + theValue + "</b></td>>"
else if (theTag == "INPUT" && this.type == 'text')
theValue = $(this).val();
if (theValue != null)
tdworksheet += "<td class='col-sm-2'><b>" + theValue + "</b></td></tr>"
);
$('#tblWorksheet tbody').append(tdworksheet);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table id="tblWorksheet" border=1>
<tbody></tbody>
</table>
<div id="Worksheet" class="divparent">
<div>
<p class="text-info" style="margin-left:10px;">
Please enter the following deck information.
</p>
</div>
<div class="row" id="divProp" style="display:none;">
<div class=" col-md-5 text-right">
<label title="Property Size">Property Size</label>
</div>
<div class="col-sm-4 text-left">
<input class="form-control" id="propsize" name="PropSize" type="text" value="100" />
</div>
</div>
<div class="row" id="divWorkType">
<div class="col-md-5 text-right">
<label id="lblWorkType" title="WorkType">Work Type</label>
</div>
<div class="col-sm-4 text-left">
<input Value="DISTURB" class="form-control" disabled="True" id="WORKTYPE" name="WORKTYPE" type="text" value="" />
</div>
</div>
</div>
$('#tblWorksheet tbody').empty();
var tdworksheet;
$('#Worksheet label, #Worksheet input, #Worksheet select').each(function(index, element) // context is
var theTag = this.tagName;
var TF;
if($(this).parent().is('div') && !$(this).parent().is(':visible'))
return true;
if (theTag == "LABEL")
theValue = $(this).attr('title')
if (theValue != null)
tdworksheet += "<tr><td class='col-sm-2'><b>" + theValue + "</b></td>>"
else if (theTag == "INPUT" && this.type == 'text')
theValue = $(this).val();
if (theValue != null)
tdworksheet += "<td class='col-sm-2'><b>" + theValue + "</b></td></tr>"
);
$('#tblWorksheet tbody').append(tdworksheet);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table id="tblWorksheet" border=1>
<tbody></tbody>
</table>
<div id="Worksheet" class="divparent">
<div>
<p class="text-info" style="margin-left:10px;">
Please enter the following deck information.
</p>
</div>
<div class="row" id="divProp" style="display:none;">
<div class=" col-md-5 text-right">
<label title="Property Size">Property Size</label>
</div>
<div class="col-sm-4 text-left">
<input class="form-control" id="propsize" name="PropSize" type="text" value="100" />
</div>
</div>
<div class="row" id="divWorkType">
<div class="col-md-5 text-right">
<label id="lblWorkType" title="WorkType">Work Type</label>
</div>
<div class="col-sm-4 text-left">
<input Value="DISTURB" class="form-control" disabled="True" id="WORKTYPE" name="WORKTYPE" type="text" value="" />
</div>
</div>
</div>
answered Mar 22 at 12:58
Prabu samvelPrabu samvel
590210
590210
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55299874%2fskip-div-section-when-it-is-display-none-while-displaying-html-content%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Hint: Use api.jquery.com/css to read the current display status of an element
– ADyson
Mar 22 at 12:48