How to populate an input text field attribute
We have a form that includes the following checkbox:
- <input type="checkbox" name="status" id="fee" data-subscription="">
I'm trying to write a script that inserts a value into data-subscription. Here's what I have so far, but it's not populating the data-subscription value.
- if (globally == true) {
- $('input[name="status"]').attr("data-subscription","false")
- } else {
- $('input[name="status"]').attr("data-subscription","true")
- }