sovsem-nub,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
tw.yellow a, tw.yellow .item_add{
background-color: #FFFF00;
}
tw.yellow:after {
content: "добавлено";
}
</style>
<script>
window.addEventListener('DOMContentLoaded', function() {
var nodes = document.querySelectorAll('.simpleCart_shelfItem'),
item = {name : 10010};
[].forEach.call( nodes, function(tw) {
var a = tw.querySelector('[href="'+'#'+ encodeURIComponent(item.name)+'"]');
if(a){
tw.classList.add("yellow")
}
});
});
</script>
</head>
<body>
<tw class="simpleCart_shelfItem">
<span class="item_nazvanie" itemprop="name">
<a class="tc-tiddlylink tc-tiddlylink-resolves" href="#10010">Букет для любимой девушки ➨</a>
</span>
<input class="item_add" type="button" value="в корзину">
</tw>
</body>
</html>