To get value of element by id from document is very easy:
var example = document.getElementById('myId');

But what if I would like to get value by id from variable:
var example1 = '<a href="example.html" id="myId">lorem ipsum</a>'

Is there any way?