Suoritettu

Convert HTML Dom Nodes TagNames into Nested String

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

Taidot: JavaScript, HTML5, HTML

Näytä lisää: convert html php website flash, convert html joomla template, convert html pdf class, freelancer convert html joomla, convert html div css, need convert html, processing html dom, convert html php form, vbnet string html dom, convert html to json string online, convert html string to pdf c#, convert html string to image in asp.net c#, convert html to string php, convert html string to jsx

Tietoa työnantajasta:
( 37 arvostelua ) Brixham, United Kingdom

Projektin tunnus: #29032774

Myönnetty käyttäjälle:

azizahmed45

Hey, I read your job description. I can solve your code problem to in javascript. please contact for disscuss more

$15 USD 1 päivässä
(1 arvostelu)
0.8

9 freelanceria on tarjonnut keskimäärin $37 tähän työhön

subhajit2306

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

$20 USD 1 päivässä
(22 arvostelua)
4.7
milandjokic

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ää

$20 USD 7 päivässä
(15 arvostelua)
4.9
Vitaliy23Avram

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.

$50 USD 1 päivässä
(6 arvostelua)
4.6
meeshal1994

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

$75 USD 3 päivässä
(29 arvostelua)
5.1
ramakrishnapanig

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ää

$60 USD 1 päivässä
(38 arvostelua)
4.1
baltickriscoder

★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ 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ää

$50 USD 2 päivässä
(17 arvostelua)
4.0
drsaurabhkwatra

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

$20 USD 2 päivässä
(5 arvostelua)
3.3
maksimbalashov

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ää

$20 USD 7 päivässä
(0 arvostelua)
0.0