I am having a problem with my javascript that I can't quite explain. Here is the html:
<body>
<div id='slidecarousel' class='slide1' onclick='No functions can be here'>
<div id="sliderButton" onclick='pageSlider(this)'>Next Slide</div>
<div id='piece of slider...'></div>
<div...></div>
...
</div>
</body>
Here is the javascript and the error:
function pageSlider(elem)
{
    var pDiv = $(elem).parent('#slidecarousel')
    if ( pDiv.className.match(/(?:^|\s)slide1(?!\S)/) ){
**Uncaught TypeError: cannot call method 'match' of undefined**
         pDiv.className = "slide2";
    } else {
    pDiv.className = "SlideErr";
}
}
 
     
    