I am a novice in node-red, a barcode input binding project. I want to clear the barcode data by clicking the button and set the focus for the text field to reduce the click time. What should I do? I have been trying for several hours and still haven't succeeded. Please help me, thank you!
[
{
"id": "10347ce3.586fb3",
"type": "ui_button",
"z": "d5e31309.28ca2",
"name": "",
"group": "9c9a39bf.1be348",
"order": 2,
"width": 2,
"height": 1,
"passthru": false,
"label": "clean",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "buttona",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "",
"topicType": "str",
"x": 210,
"y": 340,
"wires": [
[
"2c849fb770fa722f"
]
]
},
{
"id": "a0afafc2f94aa44c",
"type": "ui_text_input",
"z": "d5e31309.28ca2",
"name": "",
"label": "Barcode_1",
"tooltip": "",
"group": "9c9a39bf.1be348",
"order": 1,
"width": 6,
"height": 1,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "topic",
"sendOnBlur": true,
"className": "myclass_clean",
"topicType": "msg",
"x": 590,
"y": 340,
"wires": [
[]
]
},
{
"id": "ab777a166bc90d1e",
"type": "ui_template",
"z": "d5e31309.28ca2",
"group": "9c9a39bf.1be348",
"name": "test",
"order": 10,
"width": 0,
"height": 0,
"format": "<script>\n action = function(){\n document.getElementById('myclass_clean').focus();\n }\n</script>\n<md-button onclick= 'action()'>\n<style>\n [node-id='87cecd4991652066'] {\n onclick='action()';\n }\n\n<style>\n",
"storeOutMessages": true,
"fwdInMessages": true,
"resendOnRefresh": true,
"templateScope": "local",
"className": "",
"x": 490,
"y": 300,
"wires": [
[]
]
},
{
"id": "98887f3e0df97d45",
"type": "ui_text_input",
"z": "d5e31309.28ca2",
"name": "",
"label": "Barcode_2",
"tooltip": "",
"group": "9c9a39bf.1be348",
"order": 3,
"width": 6,
"height": 1,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "topic",
"sendOnBlur": true,
"className": "myclass_clean",
"topicType": "msg",
"x": 590,
"y": 380,
"wires": [
[]
]
},
{
"id": "87cecd4991652066",
"type": "ui_button",
"z": "d5e31309.28ca2",
"name": "",
"group": "9c9a39bf.1be348",
"order": 4,
"width": 2,
"height": 1,
"passthru": false,
"label": "clean",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "buttona",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "",
"topicType": "str",
"x": 210,
"y": 380,
"wires": [
[
"0e280b9d6c732bb5"
]
]
},
{
"id": "2c849fb770fa722f",
"type": "change",
"z": "d5e31309.28ca2",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 370,
"y": 340,
"wires": [
[
"a0afafc2f94aa44c"
]
]
},
{
"id": "0e280b9d6c732bb5",
"type": "change",
"z": "d5e31309.28ca2",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 370,
"y": 380,
"wires": [
[
"98887f3e0df97d45"
]
]
},
{
"id": "9c9a39bf.1be348",
"type": "ui_group",
"name": "Group1",
"tab": "de7542ce.e7d19",
"order": 2,
"disp": true,
"width": 8,
"collapse": false
},
{
"id": "de7542ce.e7d19",
"type": "ui_tab",
"name": "Tab1",
"icon": "dashboard",
"order": 31
}
]