jeudi 13 août 2015

Does .wrap( ) cancel the wrappers style properties?

I have a button:

var button = ($('<button>', {
            "id": "jspsych-free-sort-done-btn",
            "class": "jspsych-free-sort",
            "html": "Done",
            ...
}));

that I want to center. Someone on stackoverflow suggested using .wrap() to add a wrapper div but this doesn't seem to be centering the button:

button.wrap("<div style='text-align:center'> </div>");

Does .wrap() cancel the wrapper's style properties? And if so how to I center my button? Thanks!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire