So I want to Substring the selected attribute, but i get the error: "TypeError: src is undefined"
Heres the Code:
js
function reset_select(){
var src = $('td.onedit').prop('id');
var new_stuhl = src.substr(1, 1);
...
}
Html:
<tr>
<td id="s1.1" class="names onedit"><p class="name">Name Name</p></td>
</tr>
console.log(src) gives me the string 's1.1' and typeOf is 'string'. When I change
var src = "s1.1";
it works. I'm using jQuery 3.2.1.
Why does this not work? Is there soething wrong with the selector?