I’m still learning how to write functions..
I want to be able to click on an item, and it will add onto a function
<a href='#' onclick="play('url1')">Item 1</a>
<a href='#' onclick="play('url2')">Item 2</a>
<a href='#' onclick="play('url3')">Item 3</a>
So if I’m trying to access any of these items, one, two or even all three at the same time, how do I call it into a function if I have something like this
function play(url_src){
}
src would only be using one item at a time? is there an array associated to this?
do I have to do something like this
function play(url_src[]){
}
Make your parameter an array:
And parse it as such:
I use the
ifstatement on the second line to account for the parameter not being an array, like so: