Update 2 exact same images source using javascript

后端 未结 1 1896
予麋鹿
予麋鹿 2021-01-29 00:00

I using PHP captcha called Cryptographer captchan.fr site

I need to use 2 captcha on same page but i have problem they do get generated but when i click refresh only fir

相关标签:
1条回答
  • 2021-01-29 00:37

    You can't have more than one element with same ID on page. That may be why it's only hitting the first one. If you add a class to both images called "captcha" you can easily do this with jQuery:

    $('.captcha').attr('src', 'cryptographp.html?cfg=0&&'+Math.round(Math.random(0)*1000)+1);
    
    0 讨论(0)
提交回复
热议问题