C++ Not-So-Simple Entire HTML Generating Code v0.3
I see some things that may help you improve your code.

Prefer class to struct

The way it's currently defined, any code can modify the contents of the structure.  Better would be to make the data members private and provide necessary accessors to assure that the class is always complete and coherent.

Don't use parallel structures

Right now, the tag attributes and tag contents are stored in parallel vectors. The only association between an attribute and its value is that they have the same position within both vectors.  Instead, use a std::pair and create a vector of those.  That way, each attribute is a single entity.  We can replace the two vectors with this one:

std::vector&lt;std::pair&lt;std::string,std::string&gt;&gt; attributes;


Use "range-for" to simplify code

C++11 and newer allow the use of "range-for" which can really simplify code.  For instance, the current code has this loop:

unsigned int i2;
for(i2 = 0; i2 &lt; myHTML.tagattrcontent.size(); i2++) {
    std::cout &lt;&lt; myHTML.tagattrcontent[i2] &lt;&lt; ":" &lt;&lt; myHTML.attributes[i2] &lt;&lt; std::endl;
}


If we follow the previous point and have a single attributes vector instead, we can rewrite this as:

for (const auto &amp;attr : myHTML.attributes) {
    std::cout &lt;&lt; attr.first &lt;&lt; ":" &lt;&lt; attr.second &lt;&lt; std::endl;
}


Use const where practical

In the returnTag routine, the underlying HtmlTag is not altered.  Make this explicit by declaring that method const:

std::string returnTag() const {


Think of the user

As a user of this code, I think I'd prefer to remove an attribute by name rather than by position.  It's also not clear that returning the new count of attributes would be useful if the caller already has to keep track of the indexing.

Provide a constructor

It seems to me that it would be nice to be able to write code like this:

HtmlTag myHTML{"foo","bar",{{"spam","eggs"}}};


We can do that by providing the appropriate constructor.  In this case, it's actually quite simple:

HtmlTag(std::string name, std::string content, std::vector&lt;std::pair&lt;std::string,std::string&gt;&gt; attr) :
    tagname{name},
    tagcontent{content},
    attributes{attr}
{}


Note that I'm assuming the attributes are now pairs as previously suggested.

Use your own code

Why doesn't the generateHTML code use any HtmlTags?  Here's a way it could be rewritten to do so:

std::string generateHTML(std::string doctype, std::string headtext, std::string bodytext) {
    HtmlTag body{"body",bodytext};
    HtmlTag head{"head",headtext};
    HtmlTag html{"html",head.returnTag()+body.returnTag()};
    return "&lt;!DOCTYPE " + doctype + " /&gt;\n\n" + html.returnTag();
}


If that's not the way you'd like to write the code, it may suggest some improvements that might be made to the HtmlTag class.