0

I have a working function on button click, I need to remove the button and run the function as the page loads completely. Could somebody help me to do that. I am doing this on wix.

export function button1755_click(event) {
$w("#ddCabinet").selectedIndex = 15;
$w("#dropdown25").selectedIndex = 0;
$w("#dropdown26").selectedIndex = 1;
$w("#inteldropdown1").selectedIndex = 0;
$w("#ddGraphiccard").selectedIndex = 1;
$w("#ddGraphiccardQty").selectedIndex = 0;
}
Avi
  • 63
  • 7
  • 1
    try using **window.onload** in JavaScript. also: [window.onload vs document.onload](https://stackoverflow.com/questions/588040/window-onload-vs-document-onload) – ahsan Jul 23 '21 at 18:28

1 Answers1

0

$( document ).ready(function() {
    console.log( "ready!" );

    // your code here

});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
AlexSp3
  • 2,201
  • 2
  • 7
  • 24
  • is that applicable for wix ??? as i have seen there scripts start from $w?? I m new in programming – Avi Jul 23 '21 at 18:35
  • and where should i put my rest codes i mentioned??? as you closed the function – Avi Jul 23 '21 at 18:36
  • `$w` is apparently an alias for jQuery on your site. You'd use it instead of just `$`, which is the default alias for `jQuery`. – isherwood Jul 23 '21 at 18:36
  • Your code would replace the sample console log code, inside the `.ready` function. – isherwood Jul 23 '21 at 18:38