Matarishvan
Matarishvan

Reputation: 2422

Special characters in javascript onClick paramerters

I have a javascript onclick function. I am passing certain values which has special characters inside onclick.

<a href="#" onclick="editLocation(34:B1:F7:D5:BB:52)">click</a>

which gives me an error

enter image description here

How do i pass all the value inside onclick.. I don't want to ignore special character. I must pass the complete value 34:B1:F7:D5:BB:52

Upvotes: 1

Views: 1074

Answers (1)

Oleksandr T.
Oleksandr T.

Reputation: 77482

Add single quotes, like this

<a href="#" onclick="editLocation('34:B1:F7:D5:BB:52')">click</a>

Example

Upvotes: 2

Related Questions