This is the most generous of the jQuery attribute selectors that match against a value. jQuery val() method is used to get the value of an element. js input value keypress. get data from json placeholder. The following example will add a red outline around the inputs if Method 1: Using the prop method: The input can be accessed and its property can be set by using the prop method. You can use the val() method to test or check if inputs are empty in jQuery. Can be either a valid identifier or a quoted string. Answer: Use the jQuery val() Method. $('#checkbox_id').val(); The :checkbox selector selects input elements with type checkbox.