Convert HTML Dom Nodes TagNames into Nested String
Budjetti $10-30 USD
Requirements:
A Function coded in JS ECMAScript 5.1 (no jquery) is passed an HTML dom node.
The function needs to iterate through the whole dom structure of that node and all nested childnodes.
Use a counter starting from one with prefix 'n' and build an ordered string containing the nested TagNames and textContent represented by the counter and nested square brackets and return the string.
Text nodes, br and any other empty tagNames have an opening and closing bracket [] in the finished string.
Example:
<div id="start">1111<div>2222<div>3333<div>4444<h3 style="text-align: center;"><span style="font-family: 'Lora',georgia,'times new roman',serif;">Example</span>7777</h3>5555<br><h3 style="text-align: center;">6666<span style="font-family: 'Lora',georgia,'times new roman',serif;">Text</span></h3></div></div></div></div>
[login to view URL](htmlMap([login to view URL]('start')));
(testing purposes use tagName and textContent)
DIV[aaaa[]DIV[bbbb[]DIV[cccc[]DIV[dddd[]H3[SPAN[Example[]]eeee[]]ffff[]BR[]H3[gggg[]SPAN[Text[]]]]]]]
(actual result)
n1[n2[]n3[n4[]n5[n6[]n7[n8[]n9[n10[n11[]]n12[]]n13[]n14[]n15[n16[]n17[n18[]]]]]]]
FYI:
The html used will be varied with many different nested childnode structures, however the html will only use the following tagNames.
tags = ['a', 'br', 'blockquote', 'div', 'em','h1', 'h2', 'h3', 'h4', 'h5', 'h6','hr', 'i', 'img', 'li', 'ol', 's','span', 'strong', 'style', 'table', 'td','text-align', 'title', 'tr', 'txt', 'u', 'ul'];
Note:
In the function, plesae include an if else statement checking for nodeType 1 and nodeType 3, as I will need to expand the code to do additional tasks.
This task is required ASAP
Thanks
Steve
Myönnetty käyttäjälle:
Hey, I read your job description. I can solve your code problem to in javascript. please contact for disscuss more
9 freelanceria on tarjonnut keskimäärin $37 tähän työhön
Hello I am a web expert. i can do design with PHP, Html , Js , css , bootstrap, have done many websites using latest technology with better security also with facilities like email service, sms and payment gateway
Reading your job description carefully, I am feeling that I am the most qualified candidate to take this job on. I have good knowledge of PHP, HTML, Ajax, Javascript, Jquery, CSS and Bootstrap. I able to do this task v Lisää
Hello. I think that we need to use Recursive call algortihm. I can finish your project in 2 hours perfectly I am looking forward to call me Thank you.
Hello, I am a web developer and have a lot of experience in DOM manipulation. Feel free to contact me if you find the bid amount right for the project. Thanks Meeshal k
Hi! i understand your requirement . I have good expertise on bootstrap,html,css, Javascript, php. I can convert psd to html. I can Convert HTML Dom Nodes TagNames into Nested String. Please ping me for quality wor Lisää
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ I have just read your requirements and so interested in your job. Being a senior javascript developer I have 8+yrs experience in JavaScript, CSS, jQuery, Ajax. Also with react, angul Lisää
Hi there, I read your requirement. I have skill to do this project . I am full time available. Please feel free for more communication. Regards
Dear stephen Nice to meet you! I read your post carefully and felt your heart. As I am an excellent web expert, I am sure that I can deliver the high quality you want. Although my account is blank, I will show my ex Lisää