I'm trying to rewrite some code from JavaScript with "jQuery" to "Scala js" with "scalajs-jquery"
Here is my code:
val imgWidth: Int = jQuery(".advertise-wrap img").get(0).asInstanceOf[dom.html.Image].naturalWidth
This gives me error in web browser console:
jQuery$1(...).get(...) is undefined
What I'm doing wrong? How correctly to get first element?