I'm trying to order 6 blocks in 2 columns so that at higher viewports the blocks appear such as
row 1 : block 1 block 2
row 2: block 3 block 4
row 3: block 5 block 6
and on smaller viewports there would be only 1 column with blocks in ascending order 1 - 6.
I'm using flexbox but not sure how to do this without editing the html, here is the codepen, https://codepen.io/Ryanwfile/pen/qKQdwY
any help is appreciated. Thank you.
this
. When I select $(this)
it returns what looks to be an array-like object, and index 0 apparently holds all the properties I'm trying to get at. When I try to access with $(this[0])
, it instead appears to return the prototype which is not what I want. Does anyone know how to access the button properties using this
?
Thank you so much for helping me @Feldbot, although I don't understand why this worked previously, but not now. As I mentioned in my original message, I completed this challenge a while ago, and at the time, when I submitted my work, everything was working. It was not until I checked on this project a week ago that I noticed the image was no longer displaying.
Also, I ended up using span
instead of div
as it worked for me better. Thank you again @Feldbot
this
. Maybe this is what you were looking for? https://jsfiddle.net/2of5euky/20/
@Feldbot If you wanted to use $, then the following should work as well: $(this)[0]
Maybe someone can chime in and correct me if I'm wrong, but my understanding is that $(this)[0]
== this
. If you try this in the console, you'll see that both give you the same results:
<button id="btn_test" value="hi">TEST</button>