JavaScript Make all inputs with class readOnly make only inputs with type 'text',make a

So I am building a drag and drop form builder and I want to make a particular field on all the inputs readOnly. This can be

  • Select Dropdown
  • Text input
  • Number input
  • Date input

Date input

example image

All these inputs will be generated dynamically.

I had a look at How can i add readonly attribute on all input fields using javascript? & How to set readonly property to false on multiple textboxes with same class?

but none make the name input readOnly just by the class name.

I am currently doing it this way:

$("#editClick").on('click', function(){
 $('.myNameClass').attr('readonly', false);

});

But need a way to fire it every time a new field appears on the page(i.e. check is the length of a class increases)

Something like:

if ($(".myNameClass")[0]).increases -> fire event-> and every time it does
Answer:1

tl;dr: How can I chain onto Javascript's map() with my own function? Like - stuff.map(i => i.key).avg() where avg() is my own function to compute the average of the array returned by map? In ...

tl;dr: How can I chain onto Javascript's map() with my own function? Like - stuff.map(i => i.key).avg() where avg() is my own function to compute the average of the array returned by map? In ...

I am working on google bar charts but I am not able to change the background color of google barcharts. Here is my code: <script type="text/javascript"> google.load('visualization', '1', {...

I am working on google bar charts but I am not able to change the background color of google barcharts. Here is my code: <script type="text/javascript"> google.load('visualization', '1', {...

  1. change background google docs
  2. change background google slides
  3. change background google chrome
  4. change background google drawing
  5. change background google calendar
  6. change background google hangouts
  7. change background google slides app
  8. change background google sites
  9. change background google drive
  10. change background google search page
  11. change background google home hub
  12. change background google sheets
  13. change background google hub
  14. change background google slides ipad
  15. change background google earth
  16. change background google forms
  17. change background google chromecast
  18. change background google account

Table doesn't cover all div, but i give a width in 100% $("#astana").click(function(){ $(".t2").toggle(500); }); /*---tables---*/ .wrapper { margin: 0 auto; max-width: 800px; } ...

Table doesn't cover all div, but i give a width in 100% $("#astana").click(function(){ $(".t2").toggle(500); }); /*---tables---*/ .wrapper { margin: 0 auto; max-width: 800px; } ...

I am building my own type of Chrome dev tools (inspect element) which will also be in the form of a Chrome extension using JavaScript. I would like it to have some similar functionality to Chromes dev ...

I am building my own type of Chrome dev tools (inspect element) which will also be in the form of a Chrome extension using JavaScript. I would like it to have some similar functionality to Chromes dev ...