Friday, August 18, 2017

jQuery find td data

Simple jQuery Selector to highlight selected table row  
and get table data
value




$(SELECTOR_TR).click(function (e) {
                var val= $(this).find('td:eq(1)').text();
                 $(SELECTOR_TR).removeClass(CSS_CLASS_TR_SELECTED );
                $(this).addClass(CSS_CLASS_TR_SELECTED);
            });


Get selected text from dropdown


                           


 $('#SelectOption').find('option:selected').text();


https://stackoverflow.com/questions/4376664/jquery-access-input-hidden-value
You can access hidden fields' values with val(), just like you can do on any other input element:
 type="hidden" id="foo" name="zyx" value="bar" />

alert($('input#foo').val());
alert($('input[name=zyx]').val());
alert($('input[type=hidden]').val());
alert($(':hidden#foo').val());
alert($('input:hidden[name=zyx]').val());
Those all mean the same thing in this example.

No comments:

Post a Comment