Shopping Cart Items
Product
Price
Quantity
Subtotal
Alyssa Boyleg
Size
L
Color
Black
MYR43.90
Qty
MYR87.80
Sensitive data
{"ScriptPreparationCode":"var element = document.querySelector(\u0022#test\u0022);\r\n\r\nconsole.log(element.innerText);\r\nconsole.log(innerText(element));\r\nconsole.log(innerTextAdvanced(element));\r\nconsole.log(innerTextMerge(element));\r\n\r\nfunction innerText(el) {\r\n el = el.cloneNode(true) // can skip if mutability isn\u0027t a concern\r\n var nodes = el.querySelectorAll(\u0027address,*[convizit-ignore=\u0022true\u0022]\u0027);\r\n nodes.forEach(s =\u003E s.remove())\r\n return el.innerText\r\n}\r\n\r\nfunction innerTextMerge(el) {\r\n \tel = el.cloneNode(true);\r\n\tvar nodes = [];\r\n var treeWalker = document.createTreeWalker(\r\n el,\r\n NodeFilter.SHOW_ELEMENT,\r\n \t{ \r\n acceptNode: function(node) {\r\n if(isIgnored(node)) {\r\n nodes.push(node);\r\n return NodeFilter.FILTER_REJECTACCEPT;\r\n }\r\n return NodeFilter.FILTER_SKIP\r\n }\r\n }\r\n );\r\n treeWalker.nextNode()\r\n\tnodes.forEach(s =\u003E s.remove())\r\n return el.innerText;\r\n}\r\n\r\nfunction innerTextAdvanced(el) {\r\n var treeWalker = document.createTreeWalker(\r\n el,\r\n NodeFilter.SHOW_ALL,\r\n { \r\n acceptNode: function(node) {\r\n if(node.nodeType === Node.ELEMENT_NODE \u0026\u0026 (!isVisible(node) || isIgnored(node)) ) {\r\n return NodeFilter.FILTER_REJECT;\r\n }\r\n if(node.nodeName === \u0027SCRIPT\u0027 \u0026\u0026 node.nodeName === \u0027STYLE\u0027 ) {\r\n return NodeFilter.FILTER_REJECT;\r\n }\r\n return NodeFilter.FILTER_ACCEPT;\r\n }\r\n }\r\n );\r\n \r\n var text = \u0027\u0027;\r\n while(treeWalker.nextNode()){\r\n var node = treeWalker.currentNode;\r\n\r\n if(node.nodeType === 3){\r\n var value = node.textContent.trim();\r\n if(value) {\r\n text \u002B= value \u002B \u0027 \u0027;\r\n }\r\n }\r\n }\r\n\r\n return text.trim();\r\n}\r\n\r\nfunction isVisible(element) {\r\n const style = window.getComputedStyle(element);\r\n\r\n if (style.display === \u0027none\u0027) return false;\r\n\r\n if (style.visibility !== \u0027visible\u0027) return false;\r\n\r\n if (style.opacity \u003C 0.1) return false;\r\n\r\n if (element.offsetWidth \u002B element.getBoundingClientRect().width === 0) {\r\n return false;\r\n }\r\n\r\n if (element.offsetHeight \u002B element.getBoundingClientRect().height === 0) {\r\n return false;\r\n }\r\n\r\n return true;\r\n}\r\n\r\nfunction isIgnored(element) {\r\n const ignoredTags = [\u0027address\u0027];\r\n\r\n if (ignoredTags.indexOf(element.nodeName.toLowerCase()) !== -1) return true;\r\n if (element.getAttribute(\u0027convizit-ignore\u0027) === \u0027true\u0027) return true;\r\n\r\n return false;\r\n}","TestCases":[{"Name":"Delete ignored nodes and get innerText","Code":"var text = innerText(element);\r\n","IsDeferred":false},{"Name":"Itarate","Code":"var text = innerTextAdvanced(element);\r\n","IsDeferred":false},{"Name":"Merge","Code":"var text = innerTextMerge(element);\r\n","IsDeferred":false},{"Name":"innerText","Code":"var text = element.innerText;","IsDeferred":false}]}