1

I want to create a online game 'tic tac toe' using buttons in html, to make it attractive I want to use custom cursors like 'X' and 'O' and it should change alternately with each click, when tried in Microsoft frontpage 2003 I succeeded but when opened in google chrome and IE browser cursor is not changing.

I tried various methods but not able to complete that...

function cha1(){
    if(mat[0]==0){
        if(i%2==0){
            bt1.innerHTML="O";
            mat[0]=2;
        }
        else{
            bt1.innerHTML="X";
            mat[0]=1;
        }
        i=i+1;
        bt1.style.cursor='url("../cursor/no.gif")','auto';
        bt1.style.cursor='url("../cursor/no.cur")','auto';
    }
    check();
}

there are no errors or anything but the regular pointer cursor is not changing to my custom cursor. I already hosted that page if you want to visit click here "http://airgame.ml/XandO/". Please help me with this issue, Thanks in advance.

Subodh Ghulaxe
  • 18,333
  • 14
  • 83
  • 102
K Adarsh
  • 21
  • 2
  • Hi please refer to the post below https://stackoverflow.com/a/9409934/7855321 – Mahyar Mottaghi Zadeh Jul 10 '19 at 05:11
  • 1
    You're explicitly setting `cursor` to `auto`, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comma_Operator – Teemu Jul 10 '19 at 05:12
  • I tried your methods but went unsuccessful. From your response, I think this is the change you wanted. bt9.style.cursor='url("../cursor/no.gif"),auto'; bt9.style.cursor='url("../cursor/no.cur"),auto'; – K Adarsh Jul 11 '19 at 12:06

1 Answers1

1

I finally solved that,

bt9.style.cursor='url("http:airgame.ml /cursor/no.gif"),auto';

is the appropriate syntax for it. Thanks guys for helping me.

Nisse Engström
  • 4,738
  • 23
  • 27
  • 42
K Adarsh
  • 21
  • 2