MCPcopy Create free account
hub / github.com/adearriba/ShopifyCheckoutJS / addField

Method addField

src/Components/TextField.js:16–32  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

14 }
15
16 addField(args){
17 let input = document.createElement('input');
18 input.classList.add(...this.classes.fieldInput);
19 input.placeholder = (args.placeholder) ? args.placeholder : '';
20 input.size = (args.size) ? args.size : 30;
21 input.type = (args.type) ? args.type : 'text';
22 input.value = (args.defaultValue) ? args.defaultValue : '';
23
24 input.name = this.fieldName;
25 input.id = this.fieldId;
26
27 this.querySelector(this.selectors.wrapper).appendChild(input);
28
29 if(typeof args.tooltip == 'string'){
30 this.addTooltip(args.tooltip);
31 }
32 }
33
34 addTooltip(text = '', icon = '#question'){
35 this.removeTooltip();

Callers 1

constructorMethod · 0.95

Calls 1

addTooltipMethod · 0.95

Tested by

no test coverage detected