xxxxxxxxxx
// HTML markup
<div id="myDiv">Hello, World!</div>
// jQuery code
$(document).ready(function() {
// Select the element with ID "myDiv" using a specific selector name
var mySelector = "#myDiv";
// Perform actions on the selected element
$(mySelector).text("Hello, Stack Overflow!");
// Display the modified content of the selected element
console.log($(mySelector).text());
});
xxxxxxxxxx
$('td[name ="tcol1"]') // matches exactly 'tcol1'
$('td[name^="tcol"]' ) // matches those that begin with 'tcol'
$('td[name$="tcol"]' ) // matches those that end with 'tcol'
$('td[name*="tcol"]' ) // matches those that contain 'tcol'
xxxxxxxxxx
$('[name=myElementName]') //match any element with name=myElementName. i.e: <div name="myElementName"></div>
xxxxxxxxxx
if ($('[name=RDW]').val().trim() != "" && typeof ($('[name=RDW]').val().trim()) != 'undefined') {
html += "<tr><td>RDW (%)</td><td>" + $('[name=RDW]').val().trim() + "</td><td> (13-22)(15-27)</td></tr>";}
xxxxxxxxxx
// Select the input element by its name attribute
var inputElement = $('input[name="your_input_name"]');