JSFiddle - React, Tailwind, and code Playground

HTML

<div class="hidden_elem" id="ukftg4w44">
<!--<div class="mtm mlm">
    <ul>
    <li class="uiMenuItem" data-label="Report/Block...">
        <a class="itemAnchor" role="menuitem" tabindex="-1" href="/ajax/report/social.php?content_type=0&amp;cid=1352686914&amp;rid=1352686914&amp;ref=http%3A%2F%2Fwww.facebook.com%2F%3Fq&amp;h=AfjSxEzzdTSrz-pS&amp;from_gear=timeline" rel="dialog">
            <span class="itemLabel fsm">Report/Block...</span>
        </a>
    </li>
    </ul>
 </div>-->
 </div>

<div><span>HREF = </span><span id="parameter-h"></span></div>
<div><span>CID = </span><span id="parameter-cid"></span></div>
<button id="tryagain">Try it</button>

JavaScript

function getParameterByName(name, path) {
  var match = RegExp('[?&]' + name + '=([^&]*)').exec(path);
  return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}

function getAttributes(){
    var hiddenElHtml = document.getElementsByClassName('hidden_elem')[0].innerHTML.replace('<!--', '').replace('-->', '');
    
    var divObj = document.createElement('div');
    divObj.innerHTML = hiddenElHtml;
    
    var itemAnchor = divObj.getElementsByClassName('itemAnchor')[0];
    var href = itemAnchor.getAttribute('href');
    var fbId = getParameterByName('h', href);
    var cId = getParameterByName('cid', href);
    
    document.getElementById('parameter-h').innerHTML  = fbId;
    document.getElementById('parameter-cid').innerHTML  = cId;
    
    alert(fbId + "\n" + cId);
}

document.getElementById("tryagain").addEventListener("click", getAttributes, false); 

getAttributes();