If I have something like this:
<div class="class1">
<img src="image.jpg" id="image1">
</div>
How do I move this image to another div in tritium?
If I have something like this:
<div class="class1">
<img src="image.jpg" id="image1">
</div>
How do I move this image to another div in tritium?
I think this should work, try it out (class2
is the id of the class to what you want to move the image):
$("//div[contains(@class,'class2')]") {
move_here("//img[@id='image1']")
}
There might be other ways but this is quite simple and working.
I figured out that I need to use move_to()
but I don't know how exactly. If someone explain I'd be glad.
html() {
$("//img[@id='image1']") {
move_to("//div[contains(@class,'class2')]")
}
}
Can also be done using move_to function. http://tester.tritium.io/6526e5d20c148c1634bb8094fffb8c55a13c3d76