Chris
The
void simply ensures the following expression is evaluated and then returns nothing (undefined). Specifically:
https://developer.mozilla.org/en-US/...Operators/void
Without it, the browser jumps away from your site to a new page and tries to present the return value of your expression, usually, [object Object].
This is better explained in
https://en.wikipedia.org/wiki/Bookmarklet by the inventor of JavaScript.
I have explored the use of a variable declaration like, javascript
: { var xxx=$('.Hamburger').toggle(500); }, where jQuery still seems to execute but there is no return value but as I am not that knowledgeable with JS arcanery, I have stuck to what I believe is safest.
You gave the Placeholders the ClassNames: vid[1,2,3,4].
The methods are for the videos themselves so these have to be identified individually as IDs: [101vid, 102vid, 103vid, 104vid].
In JavaScript, a collection of items with ClassName is accessed with the convention of a preceding dot (e.g., .vid3) and an individual object's ID is preceded with a hash (e.g., #102vid).
Look at it just the way we accept a Tweet like
@AcornIsBrill with barely a glance.
The actual declaration of a ClassName and ID in JavaScript is with class='fred' and id='gertie', so there is no need to add the dot or hash because I have just told you what they are.
Acorn
Bookmarks