Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
100
rated 0 times [  106] [ 6]  / answers: 1 / hits: 32620  / 8 Years ago, fri, march 4, 2016, 12:00:00

I tried with old question, there they passing the value in js to js.But I would like to pass string from html to javascript. but it gives




Uncaught reference error




my html is



<a href=# onclick=test(TEST123)>


and my javascript is,



function test(p){
alert(p)
}


how can I pass the string>


More From » html

 Answers
4
<a href=# onclick=test('TEST123')>


just wite string parameter in your js function


[#63050] Wednesday, March 2, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
patriciakiarrac

Total Points: 532
Total Questions: 100
Total Answers: 89

Location: Ivory Coast
Member since Sun, Mar 7, 2021
3 Years ago
patriciakiarrac questions
;