I have html table I run on all table rows using map function:
var fieldsValuesSelection = $('tr[data-id]:not([data-id=""])').map(function () {
// check element type here
}).get();
Row contains select or input element. For example:
<tr data-id="6">
<td style="vertical-align: inherit;text-align:center;">
<label for="">diameter</label></td><td style="text-align:center;"><div class="ui-input-text ui-body-inherit ui-corner-all ui-shadow-inset">
<input type="text" id="propFieldName" data-id="6" value="4"></div>
</td>
</tr>
<tr data-id="7">
<td style="vertical-align: inherit;text-align:center;">
<label for="">state</label></td><td style="text-align:center;"><div class="ui-select">
<div id="select-41-button" class="ui-btn ui-icon-carat-d ui-btn-icon-right ui-corner-all ui-shadow">
<span>fixed</span>
<select data-realvalueid="20">
<option value="">fixed</option>
<option value="">not fixed</option>
</select>
</div></div>
</td>
</tr>
as you can see above first table row contains input second contains select element.
My question is how can I check inside map function what type of element row contains is it select or input?
if ($(this).is('input')) { // .. input }api.jquery.com/is , And you should apply that to each child element of $(this), in your case.tagName$(this).find('input').lengthto check if input is present in current element or not.