The problem is this:
'[value=' "+ checkval +"']' ^ ^ ^ ^^ 1 2 3 45
At 1 you start the line; at 2, you finish it. This means that when we reach 3, the start of a new line using double quotes, this is an unexpected line.
You probably want:
'[value="' + checkval + '"]' ^ ^^ ^^ ^ 1 23 45 6
At 1 we start the line. 2 is just " inside the line, but it doesn't end. 3 ends it, then adds checkval , then we start a new line (4) with " in it (5), followed by ] , and then the end of the line (6) .
source share