Sometimes you see the most obvious questions posted to Googlers and you think, hmm, I wonder how many others don’t think this is obvious. In any event, when you change your content and HTML on a page, it can and often does, impact your rankings for better or worse.
HTML changes without content changes can also do the same but it depends what exactly you change on the page.
John Mueller of Google was asked about this on Twitter and responded as such. John said “any change in a page’s HTML can result in changes in indexing, it all depends on what you change.”

Any change in a page’s HTML can result in changes in indexing, it all depends on what you change.
— John ☆.o(≧▽≦)o.☆ (@JohnMu) September 13, 2017
Of course, those who rank well are afraid to change anything but eventually their site can become stale and Google’s algorithms might not want to rank that stale site as well as it use to. So staying ahead of the game with your web site by making changes is kind of necessary.
Forum discussion at Twitter.

Marketing Tips