jquery set att
$input.attr("attributeName", "attributeValue");<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery Adding Attribute to HTML Element</title>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script>
$(document).ready(function(){
$(".add-attr").click(function(){
$('input[type="checkbox"]').attr("checked", "checked");
});
});
</script>
</head>
<body>
<button type="button" class="add-attr">Select Checkbox</button>
<input type="checkbox">
</body>
</html>
Also in JavaScript:
- pagination.js
- modulo operator in javascript
- react router url params
- how to restart elasticsearch node
- adding int and string in react props
- using index of on array of objects
- Geometery parsing GeoJSON
- javascript array push object
- blur javascript
- string and charater alphabet order
- how get checkbox if checked in jquery
- javascript class constructor
- slap user discord.js
- PayloadTooLargeError: request entity too large
- push notification not working on standalone react native
- javascript for schleife
- arrow function component react shortcut vscode
- reverse a string program in javascript
- convert date and time into epoch javascript
- java.lang.IllegalArgumentException: Can only download HTTP/HTTPS
- jQuery - Get Content and Attributes
- add in to array mongoose
- datatable on error.dt
- store current date in chrome storage extension