문제

I will be running the javascript through my browser (chrome) like this javascript:codegoeshere, so i cannot use jQuery. The website is not mine, so i cannot modify it. In the source code of the web page the username is stored like this:

<div class="m-names"><div class="m-h3"><strong>@usernamegoeshere</strong>

My question is, how can i parse @usernamegoeshere with javascript into a variable? I want to be able to alert the final result. Thanks to anyone that can help.

도움이 되었습니까?

해결책

Just use querySelectorAll

javascript:alert(document.querySelectorAll(".m-names .m-h3 strong")[0].innerHTML);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top