I'm using knockoutjs and I currently have something in my view that looks like this:
<img id="myTab1" data-bind="click: pressedTab.bind($data, '#myTab1')" src="images/image1.png"></img>
This allows me to get the element ID in my view model:
pressedTab = function(tab){
console.log("Element ID: " + tab);
}
This writes:
Element ID: #myTab1
However, it's too repetitive to send the name of the img id in the click event. Is there a way to send the img id without explicitly re-writing it?