skip to Main Content

How to extract specific string from HTML Element in JS?

<input id="WD01B3" ct="CB" lsdata="{2:'WD01B4',4:'Any',20:'x7bx22WDA_TYPEx22x3ax22DROPDOWN_BY_KEYx22,x22WDA_IDx22x3ax22ABCA950297D2C0C432BAB9BBF5A1BB48.07.MAINVIEW._0120x22,x22ENABLEDx22x3ax22Xx22,x22KEYSx22x3ax5bx7bx22keyx22x3ax22x22,x22valuex22x3ax22Anyx22x7d,x7bx22keyx22x3ax22ACx22,x22valuex22x3ax22Actionx22x7d,x7bx22keyx22x3ax22APx22,x22valuex22x3ax22Applicationx22x7d,x7bx22keyx22x3ax22CAx22,x22valuex22x3ax22Catalogx22x7d,x7bx22keyx22x3ax22DOx22,x22valuex22x3ax22Datax20Objectx22x7d,x7bx22keyx22x3ax22EXx22,x22valuex22x3ax22Expressionx22x7d,x7bx22keyx22x3ax22ETx22,x22valuex22x3ax22Expressionx20Typex22x7d,x7bx22keyx22x3ax22FIx22,x22valuex22x3ax22Filterx22x7d,x7bx22keyx22x3ax22FUx22,x22valuex22x3ax22Functionx22x7d,x7bx22keyx22x3ax22RUx22,x22valuex22x3ax22Rulex22x7d,x7bx22keyx22x3ax22RSx22,x22valuex22x3ax22Rulesetx22x7dx5d,x22VISIBLEx22x3ax2202x22,x22WIDTHx22x3ax22100pxx22,x22SCRIPT_METHODSx22x3ax7bx22setBackgroundColorx22x3ax22clientx22,x22setBorderColorx22x3ax22clientx22,x22setBorderRadiusx22x3ax22clientx22,x22setBorderStylex22x3ax22clientx22,x22setBorderWidthx22x3ax22clientx22,x22setFontColorx22x3ax22clientx22,x22setFontFamilyx22x3ax22clientx22,x22setFontSizex22x3ax22clientx22,x22setFontStylex22x3ax22clientx22,x22setFontWeightx22x3ax22clientx22,x22setTextDecorationx22x3ax22clientx22x7dx7d'}" lsevents="{Select:[{ResponseData:'delta',ClientAction:'submit'},{}]}" type="text" autocomplete="off" tabindex="0" ti="0" class="lsField__input" readonly="" value="Any" aria-roledescription="Select" aria-haspopup="listbox" aria-describedby=" ARIA_CB_TUT" aria-readonly="false" style="width:100px;"> Requirement: Extract ABCA950297D2C0C432BAB9BBF5A1BB48.07.MAINVIEW._0120 from the above HTML Element data. I have ABCA950297D2C0C432BAB9BBF5A1BB48.07.MAINVIEW., how can I get the remaining string/number using JavaScript?

VIEW QUESTION

Html – How to modify the event object before the DOM event callback function is executed

<body> <button onclick="myFunction()">CLICK</button> <script> function myFunction(event) { // do something based on the value of the event's property } </script> </body> <body> <button id="myButton">CLICK</button> <script> var button = document.getElementById("myButton"); button.addEventListener("click", myFunction); function myFunction(event) { // do something based on the…

VIEW QUESTION

Javascript – How can i get the child input(checkbox) html element?

This is my current code const unitDiv = document.querySelector( `[data-schemapath="${options.form_name_root}.outcomes.improvements.${outcomeIndex}.outcomes.${individualOutComeIndex}.parameters.items.${eachItemIndex}.unit"]` ); const unitDivCheckbox = unitDiv?.firstChild?.firstChild?.firstChild; if (unitDivCheckbox) { (unitDivCheckbox as HTMLElement).style.display = 'none'; } As you can see I am using multiple firstChild. I want to avoid that. What I…

VIEW QUESTION
Back To Top
Search