JSFiddle - React, Tailwind, and code Playground
HTML
<textarea id="output" style="width:100%;height:200px"></textarea>
JavaScript
var html= '<html><head><title>Session Summary</title></head><body><pre>'
+'<u>Miscellaneous</u>'
+'<strong>Session Expiration (barring inactivity):</strong> 359 minute(s)'
+'<strong>Client Address:</strong> 192.168.44.232'
+'<strong>SSO Protocol:</strong> urn:oasis:names:tc:SAML:2.0:protocol'
+'<strong>Identity Provider:</strong> https://sso.ace.amc.seoul.k/idp/shibboleth'
+'<strong>Authentication Time:</strong> 2018-10-04T06:28:32.318Z'
+'<strong>Authentication Context Class:</strong>'
+'<strong>Authentication Context Decl:</strong> (none)'
+'<u>Attributes</u>'
+'<strong>cn</strong>: ycjo'
+'<strong>email</strong>: [email protected]'
+'<strong>mail</strong>: [email protected]'
+'<strong>sn</strong>: ycjo'
+'<strong>uid</strong>: ycjo</pre></body></html>';
var code = $("<html><head><title>Session Summary</title></head><body><pre>"
+"<u>Miscellaneous</u>"
+"<strong>Session Expiration (barring inactivity):</strong> 359 minute(s)"
+"<strong>Client Address:</strong> 192.168.44.232"
+"<strong>SSO Protocol:</strong> urn:oasis:names:tc:SAML:2.0:protocol"
+"<strong>Identity Provider:</strong> https://sso.ace.amc.seoul.kr/idp/shibboleth"
+"<strong>Authentication Time:</strong> 2018-10-04T06:28:32.318Z"
+"<strong>Authentication Context Decl:</strong> (none)"
+"<u>Attributes</u>"
+"<strong>cn</strong>: ycjo"
+"<strong>email</strong>: [email protected]"
+"<strong>mail</strong>: [email protected]"
+"<strong>sn</strong>: ycjo"
+"<strong>uid</strong>: ycjo</pre></body></html>");
console.log($(html).find('div'));
console.log(code.find('div'));
code.each(function() {
alert( this.nodeValue );
})